For more information, see php array.

Source: Internet
Author: User
For more information, see php array. This is my question on other websites. please give me some advice.
// This is a standard array, which is clear at a glance, but title => $ Img ['title ?? Is the title value in the Img array? Or what? $ Item = array ('title' => $ Img ['title'], 'description' => $ Img ['text'], 'pic '=> $ Img ['Pic'], 'URL' => $ url), array ('title' => $ Img ['title'], 'description' => $ Img ['text'], 'Pic '=> $ Img ['Pic'], 'URL' => $ url ), array ('title' => $ Img ['title'], 'description' => $ Img ['text'], 'pic '=> $ Img ['Pic'], 'URL' => $ url), array ('title' => $ Img ['title'], 'description' => $ Img ['text'], 'Pic '=> $ Img ['Pic'], 'URL' => $ url ),);



The following array is more complex. what do you mean by arrival ?? For details, click here...
Array (9 ){
[0] => array (4 ){
["Title"] => string (21) "What is sales? "
["Text"] => string (66) "sales is a low-cost and cost-effective marketing method. "
["Pic"] => string (38) "http://cdn.ipai.com/1396127866.jpg"
["Url"] => string (0 )""
}
[1] => array (4 ){
["Title"] => string (23) "article Ma Yi Li Yao Di"
["Text"] => string (23) "article Ma Yi Li Yao Di"
["Pic"] => string (38) "http://cdn.ipii.com/1397285480.jpg"
["Url"] => string (0 )""
}
[2] => array (4 ){
["Title"] => string (18) "click to change password"
["Text"] => string (0 )""
["Pic"] => string (38) "http://cdn.44.com/1398879995.png"
["Url"] => string (55) "http://v.44.com/index/reg/wecha/'.w.formuser.'/shtml"
}
[3] => array (4 ){
["Title"] => string (4) "m horse"
["Text"] => string (6) "description"
["Pic"] => string (38) "http://cdn.ip.com/1398638713.jpg"
["Url"] => string (0 )""
}
};


Reply to discussion (solution)

Array ('title' => $ Img ['title'])
It refers to the key value named title = $ the value of the key name title in the Img array;

The second more complex array you mentioned is not complicated at all. it is just a common two-dimensional array. it is printed to display array (4), array (4 ), do not consider this as an array.
You define a two-dimensional array, and then var_dump ($ arr) will know.

$a = $Img['title'];........array('title'=>$a,........

Equivalent to yours

Array ('title' => $ Img ['title'])
It refers to the key value named title = $ the value of the key name title in the Img array;

The second more complex array you mentioned is not complicated at all. it is just a common two-dimensional array. it is printed to display array (4), array (4 ), do not consider this as an array.
You define a two-dimensional array, and then var_dump ($ arr) will know.


Thank you!

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.