Join Up!
104884 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousksortnatcasesortnext
Last updated: Sun, 27 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Finnish | German | Spanish

list

(PHP 3, PHP 4 )

list -- Přiřadit hodnoty přoměnným jako kdyby byly polem

Popis

void list ( mixed ...)

Stejně jako array(), list() vlastně není funkce, ale jazykový konstrukt. Používá se k přiřazení hodnot více proměnným v jedné operaci.

Příklad 1. Ukázka list()

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

<?php

$result = mysql ($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>

Viz také: each() a array().

User Contributed Notes
list
add a note about notes
There are no user contributed notes for this page.
previousksortnatcasesortnext
Last updated: Sun, 27 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST