mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 23:28:22 +02:00
5b1dc40a56
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@78203 c90b9560-bf6c-de11-be94-00142212c4b1
72 lines
2.0 KiB
XML
72 lines
2.0 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./es/functions/array.xml, last change in rev 1.1 -->
|
|
<!-- last change to 'list' in en/ tree in rev 1.2 -->
|
|
<refentry id="function.list">
|
|
<refnamediv>
|
|
<refname>list</refname>
|
|
<refpurpose>
|
|
Asigna variables como si fueran una matriz
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descripción</title>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>list</methodname>
|
|
<methodparam rep="repeat"><type>mixed</type><parameter>...</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Como <function>array</function>, esta no es realmente una función,
|
|
sino una construcción del lenguaje. <function>list</function> se
|
|
usa para asignar una lista de variables en una sola operación.
|
|
<example>
|
|
<title>Ejemplo de <function>list</function></title>
|
|
<programlisting role="php">
|
|
<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>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Vea también: <function>each</function>, <function>array</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|