list

(unknown)

list --  Weist Variablen zu, als wären sie ein Array

Beschreibung

void list (...)

Wie array() ist auch dies keine wirkliche Funktion, sondern ein Sprachkonstrukt. list() wird verwendet, um eine Liste von Variablen innerhalb einer Operation zuzuweisen.

Beispiel 1. list()


<table>
 <tr>
  <th>Employee name</th>
  <th>Salary</th>
 </tr>

<?php

$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");
}

?>

</table>
      

Siehe auch: each() und array().