我的代码是
<tr>
<td><input type="text" name="batch_code[]"/></td>
<td><input type="text" name="description[]"/></td>
<td><input type="text" size="12" name="qty[]"/></td>
<td>
<select id="asset_id" class="asset_id" name="asset_id[][]" multiple="multiple">
<option class="dropdownlist">Asset Id 1</option>
<option class="dropdownlist">Asset Id 2</option>
<option class="dropdownlist">Asset Id 3</option>
</select>
</td>
</tr>
<tr>
<td><input type="text" name="batch_code[]"/></td>
<td><input type="text" name="description[]"/></td>
<td><input type="text" size="12" name="qty[]"/></td>
<td>
<select id="asset_id" class="asset_id" name="asset_id[][]" multiple="multiple">
<option class="dropdownlist">Asset Id 1</option>
<option class="dropdownlist">Asset Id 2</option>
<option class="dropdownlist">Asset Id 3</option>
</select>
</td>
</tr>
我想在数组中获取数组。但是如果我得到这个asset_id的print_r()。结果是 Array ( [0] => Array ( [0] => Asset Id 1 )
[1] => Array
(
[0] => Asset Id 2
)
[2] => Array
(
[0] => Asset Id 1
)
[3] => Array
(
[0] => Asset Id 3
)
)
但我想要什么
Array
(
[0] => Array
(
[0] => Asset Id 1
[1] => Asset Id 2
)
[1] => Array
(
[0] => Asset Id 1
[1] => Asset Id 3
)
)
我使用一个方括号“name="asset_id[]"" 运行此代码,但结果是
Array (
[0] => Asset Id 1
[1] => Asset Id 2
[2] => Asset Id 1
[3] => Asset Id 3
)
请帮我..