当前位置: 代码迷 >> PHP >> thinkphp里 表单提交数组的有关问题
  详细解决方案

thinkphp里 表单提交数组的有关问题

热度:88   发布时间:2016-04-28 19:38:13.0
thinkphp里 表单提交数组的问题
表单
<td class="norightborder">
<tbody>
<tr >
<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td>
<td><input type="text" name="listorder[]" value="1" style="width:35px;" class="px"></td>
</tr>
<tr >
<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td>
<td><input type="text" name="listorder[]" value="2" style="width:35px;" class="px"></td>
</tr>
<tr >
<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td>
<td><input type="text" name="listorder[]" value="3" style="width:35px;" class="px"></td>
</tr>


提交到后台打印出的数组是这样的
string(5) "Array"    怎么才能显示出值
------解决方案--------------------
如果  $_POST 是多维数组,则除一维都会出问题

这样写比较好
array_walk_recursive($_POST, 'trim');
array_walk_recursive($_GET, 'trim');