How to convert the received array into the following format? & Lt; input & nbsp; type = "text" & nbsp; name = "name []" & nbsp; value = "name" & nbsp;/& gt; & lt; input & nbsp; type = "text" & nbsp; name = "age []" & How does nbsp 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
)
)
------ Best solution --------------------
foreach($_POST['name'] as $k=>$v){
$arr[]=array('name'=>$v,'age'=>$_POST['age'][$k]);
}
print_r($arr);
------ Other solutions --------------------
Did not understand. Is the form not fully pasted?
------ Other solutions --------------------
Paste all. I am submitting POST,
Then generate the corresponding two-digit array.
Reference:
Did not understand. Is the form not fully pasted?
------ Other solutions --------------------
What is the relationship with the following array?
------ Other solutions --------------------
It means you have not understood it.
------ Other solutions --------------------
I want to generate
Array
(
[0] => Array
(
[url] => /uploads/1562313.84986000.jpg
[alt]=>24234
)
[1] => Array