Home >Backend Development >PHP Tutorial >thinkphp里 表单提交数组的有关问题

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

WBOY
WBOYOriginal
2016-06-13 11:50:41916browse

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');

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn