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