list

void list(mixed varname, mixed ...) 

Populates a list of variables with the values of an array.

Returns:

Not applicable.

Description:

This is perhaps the strangest construct (it’s not really a function) in the PHP language; it’s the only one that’s intended to appear on the left side of an assignment statement. To use list(), you place a comma-separated list of variables (which need not exist beforehand) into the argument list, and then assign the value of an array to list(). Each variable listed is then populated with the value of the corresponding element from the array.

  • If there are more elements in the array than variables listed, the extra elements are ignored.

  • If there are more variables listed than elements in the array, a warning ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.