我已经在表格中使用了几次方括号,但是我很困惑,因为我现在正在使用 Twitter BootStrap 进行工作(这会有什么不同吗?)没有发送数据(!) - 12 年的编码,现在我'我问这个傻q。
我通常可以做的是手动(或通过循环) echo $_POST['itemnum'][0] / $_POST['itemnum'][1] / etc - 但它回来是空的..
<form method="POST" action="'.phpself.'" class="form-horizontal" role="form">
...(table with 3 identical rows)..
<tr>
<td >
<input type="text" name="itemnum[]" class="form-control" id="inputEmail3" placeholder="Item #"></td>
<td ><input type="text" name="itemdesc[]" class="form-control" id="inputEmail3" placeholder="Description"></td>
<td ><input type="number" name="itemqty[]" class="form-control" style="max-width:80px;display:inline" placeholder="Qty"></td>
</tr>
....
</form>
var_dump:
array(5) { ["itemnum"]=> string(0) "" ["itemdesc"]=> string(0) "" ["itemqty"]=> string(0) "" ["message"]=> string(24) " d hef s s dvs sd vsd vs" ["submitRFQ"]=> string(0) "" }