List language structure in notes 012PHP

Source: Internet
Author: User
PHP has something similar to function usage, called the syntax structure. This feature is generally introduced in the function. Currently, Hy369 has the following syntax structures: echo, print, and array. Of course, the list mentioned here is also a syntax structure. PHP has something similar to function usage, called the syntax structure. This feature is generally introduced in the function. Currently, Hy369 has the following syntax structures: echo, print, and array. Of course, the list mentioned here is also a syntax structure.

There are no other syntax structures, and Hy369 is not particularly focused on this, so it is not very clear. I will pay attention to it later.

The function of list is to assign values to a group of variables using arrays. Its syntax is:

list(var1,var2...)

You can easily assign values in the array to the specified variable through list. Here are two examples:

 "Dog","b"=>"Cat","c"=>"Horse");print_r($a);

Output result:

Array ( [a] => Dog [b] => Cat [c] => Horse )
 
Here I only use the Dog and Horse variables.

Pay attention to the second example. Previously, Hy369 wrote code similar to list ($ a, $ B, $ c) = $ array to get the value of a non-first array, then output the value of $ c that I only need. At that time, I still don't know how to directly write it into list (, $ c) = $ arra (note the comma ). I want to think about it now, but I still feel a little ashamed.

The above is the content of the list language structure in note 012 PHP. For more information, see PHP Chinese website (www.php1.cn )!

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.