【发布时间】:2020-04-09 17:38:12
【问题描述】:
我想将输入值保存到二维数组中。
<table>
<?php
$kriteria = array('IP', 'SE', 'PE', 'BE');
?>
<thead>
<tr>
<th>Kriteria</th>
<?php
foreach ($kriteria as $val) {
echo '<th>' . $val . '</th>';
}
?>
</tr>
</thead>
<tbody>
<?php $n = count($kriteria); ?>
<?php for ($i = 0; $i < $n; $i++): ?>
<tr>
<th>
<?= $kriteria[$i] ?>
</th>
<?php for ($j = 0; $j < $n; $j++): ?>
<td><input type="text" class="form-control" id="<?= $kriteria[$j] . $kriteria[$i] ?>" name="<?= $j. $i ?>" value=""></td>
<?php endfor; ?>
</tr>
<?php endfor; ?>
</tbody>
</table>
我尝试了POST 方法,但没有成功。
我想使用输入中的值在另一个页面中计数。
【问题讨论】:
-
当你说我尝试了
POST方法你到底尝试了什么?
标签: php html arrays forms input