Which one of the following assigns variable as if they were arrays?
-
Assign
-
Include
-
List
-
All of the above
C
Correct answer
Explanation
The list() construct in PHP assigns array elements to variables in a single operation, treating the array values as if they were being assigned to individual variables. It's commonly used with arrays that have numeric indices. For example: list($a, $b) = array(1, 2) assigns 1 to $a and 2 to $b.