How to convert the received array to the above format

Source: Internet
Author: User
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
)

)

------ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.