Look at the PHP manual, there is a paragraph not quite understanding in the introduction of list, given the following warning: list () assignsthevaluesstartingwiththeright-mostparameter.Ifyouareusingplainvariables, youdonthavetoworryaboutthis. Buti see PHP manual, there is a paragraph not quite understanding
The following warning is provided during the introduction of list:
List () assigns the values starting with the right-most parameter. if you are using plain variables, you don't have to worry about this. but if you are using arrays with indices you usually expect CT the order of the indices in the array the same you wrote in the list () from left to right; which it isn' t. it's assigned in the reverse order.
I don't quite understand the translation. does list have subscripts? Why is the list assigned a value from right to left? What is the opposite of list subscript and array subscript?
I am a newbie. I am very grateful to anyone who wants to answer this question !!!!
------ Solution --------------------
The following are examples in the manual.
$ Info = array ('Coffee ', 'Brown', 'Caffeine ');
List ($ a [0], $ a [1], $ a [2]) = $ info;
Var_dump ($ );
Output
Array (3 ){
[2] =>
String (8) "caffeine"
[1] =>
String (5) "brown"
[0] =>
String (6) "coffee"
}
Can you see the problem ,? If not, run it like this.
$ Info = array ('Coffee ', 'Brown', 'Caffeine ');
List ($ a [], $ a [], $ a []) = $ info;
Var_dump ($ );
------ Solution --------------------
Example 1
PHP code
List ($ a, $ B, $ c) = array (1, 2, 3); print_r (array ($ a, $ B, $ c ));
------ Solution --------------------
You have a Chinese comment! Http://php.net/manual/zh/function.list.php
HTML code
Warninglist () is assigned a value starting from the rightmost parameter. If you use simple variables, don't worry about this. However, if you use an array with indexes, the expected results are usually the same as those written in list (), but they are not. Values are assigned in reverse order.