How to convert the received array into the following format? & Lt; input & nbsp; typetext & nbsp; namename [] & nbsp; value name & nbsp; & gt; & lt; input & nbsp; typetext & nbsp; nameage [] & nbsp; value15 & nbsp; & gt; & lt; input & nbsp; type how to convert the received array to the following format?
How can I receive such an array? Pic => (
* 0 => array (
* Name => name
* Age => 15
*),
0 => array (
* Name => name
* Age => 30
*),
What I receive is:
Array
(
[url] => Array
(
[0] => /uploads/13534190820.84986000.jpg
[1] => /uploads/13534190830.00999000.jpg
[2] => /uploads/13534190830.09639600.jpg
[3] => /uploads/13534190830.18655000.jpg
)
[alt] => Array
(
[0] => 24234
[1] => 23423
[2] => 424
[3] => 24234
)
)
------ Solution --------------------
foreach($_POST['name'] as $k=>$v){
$arr[]=array('name'=>$v,'age'=>$_POST['age'][$k]);
}
print_r($arr);