受け取った配列を次の形式に変換するにはどうすればよいですか?
<input type="text" name="name[]" value="姓名" /><br /> <input type="text" name="age[]" value="15" /><br /> <input type="text" name="name[]" value="姓名" /><br /> <input type="text" name="age[]" value="15" />我要怎么接收,才能成这样的数组?pic=>(<br /> * 0=>array(<br /> * name=>姓名<br /> * age=>15<br /> * ),<br /> 0=>array(<br /> * name=>姓名<br /> * age=>30<br /> * ),
Array<br /> (<br /> [url] => Array<br /> (<br /> [0] => /uploads/13534190820.84986000.jpg<br /> [1] => /uploads/13534190830.00999000.jpg<br /> [2] => /uploads/13534190830.09639600.jpg<br /> [3] => /uploads/13534190830.18655000.jpg<br /> )<br /> <br /> [alt] => Array<br /> (<br /> [0] => 24234<br /> [1] => 23423<br /> [2] => 424<br /> [3] => 24234<br /> )<br /> <br /> )
foreach($_POST['name'] as $k=>$v){<br /> $arr[]=array('name'=>$v,'age'=>$_POST['age'][$k]);<br /> }<br /> print_r($arr);
配列<br> (<br> [0] => 配列<br> (<br> [alt]=>24234<br> )<br> <br> [1] => 配列 <br><div class="clear"></div>