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: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | German

list

(PHP 3, PHP 4 )

list --  Asigna variables como si fueran una matriz

Descripción

void list ( mixed ...)

Como array(), esta no es realmente una función, sino una construcción del lenguaje. list() se usa para asignar una lista de variables en una sola operación.

Ejemplo 1. Ejemplo de list()

<table>
 <tr>
  <th>Nombre empleado</th>
  <th>Sueldo</th>
 </tr>

<?php

$resultado = mysql($conn, "SELECT id, nombre, salario FROM empleados");
while (list($id, $nombre, $salario) = mysql_fetch_row($resultado)) {
    print(" <tr>\n".
          "  <td><a href=\"info.php3?id=$id\">$nombre</a></td>\n".
          "  <td>$salario</td>\n".
          " </tr>\n");
}

?>

</table>

Vea también: each(), array().

User Contributed Notes
list
add a note about notes
There are no user contributed notes for this page.
previousksortnatcasesortnext
Last updated: Tue, 29 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