list
PHP 4, PHP 5, PHP 7, PHP 8
list - Assign variables as if they were an array
Example #1 list examples
Example #2 Using nested list
Result: int(1)
int(2)
int(3)
Example #3 list and order of index definitions
Result: array(4) {
[2]=>
string(1) "a"
["foo"]=>
string(1) "b"
[0]=>
string(1) "c"
[1]=>
string(1) "d"
}
string(1) "c"
string(1) "d"
string(1) "a"
Example #4 list with keys
Result: id: 1, name: Tom
id: 2, name: Fred
2, 4
Example #5 An example use of list