list --  Assign variables as if they were an array


void list(...);

Like array(), this is not really a function, but a language construct. list() is used to assign a list of variables in one operation.

Example 1. List() example

  <th>Employee name</th>


$result = mysql_query ($conn, "SELECT id, name, salary FROM employees");
while (list ($id, $name, $salary) = mysql_fetch_row ($result)) {
    print (" <tr>\n".
           "  <td><a href=\"info.php3?id=$id\">$name</a></td>\n".
           "  <td>$salary</td>\n".
           " </tr>\n");



See also each() and array().