Multiple choice

Which one of the following assigns variable as if they were arrays?

  1. Assign

  2. Include

  3. List

  4. All of the above

Reveal answer Fill a bubble to check yourself
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.