首頁  >  文章  >  後端開發  >  thinkphp里 表单提交数组的有关问题

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

WBOY
WBOY原創
2016-06-13 11:50:41868瀏覽

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

<td class="norightborder"><br />		<tbody><br />			<tr ><br />				<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td><br />				<td><input type="text" name="listorder[]" value="1" style="width:35px;" class="px"></td>				<br />			</tr><br />			<tr ><br />				<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td><br />				<td><input type="text" name="listorder[]" value="2" style="width:35px;" class="px"></td>				<br />			</tr><br />			<tr ><br />				<td width="350" style="width:350px;"><input type="text" name="option[]" value="" class="px" style="width:350px;"></td><br />				<td><input type="text" name="listorder[]" value="3" style="width:35px;" class="px"></td>				<br />			</tr><br />			


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

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn