cvs: phpdoc-es / translation.xml /reference/var/functions is-null.xml is-numeric.xml is-resource.xml is-scalar.xml print-r.xml
| From: | Leonardo Boshell | Date: | Sat, 18 Oct 2003 15:44:17 +0000 |
| Subject: | cvs: phpdoc-es / translation.xml /reference/var/functions is-null.xml is-numeric.xml is-resource.xml is-scalar.xml print-r.xml | ||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-341@lists.php.net to get a copy of this message | ||
lboshell Sat Oct 18 11:44:17 2003 EDT
Added files:
/phpdoc-es/reference/var/functions is-null.xml is-numeric.xml
is-resource.xml is-scalar.xml
print-r.xml
Modified files:
/phpdoc-es translation.xml
Log:
Mas archivos de reference/var
Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.67 phpdoc-es/translation.xml:1.68 --- phpdoc-es/translation.xml:1.67 Wed Oct 15 19:53:49 2003 +++ phpdoc-es/translation.xml Sat Oct 18 11:44:16 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.67 $ --> +<!-- $Revision: 1.68 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -9,7 +9,7 @@ him a mail at rafael@php.net or visit <a href="http://www.linux-es.com/PHP/">http://www.linux-es.com/PHP/</a>. </intro> <translators> -<person name="Rafael Martinez" email=" rafael@php.net" nick="rafael" cvs="yes"/> +<person name="Rafael Martinez" email="rafael@php.net" nick="rafael" cvs="yes"/> <person name="Leonardo Boshell" email="lboshell@php.net" nick="lboshell" cvs="yes"/> <person name="Robert Sánchez" email="reven@php.net" nick="reven" cvs="yes"/> <person name="Pablo Daniel Rigazzi" email="webstudio@php.net" nick="webstudio" cvs="yes"/> @@ -32,11 +32,6 @@ <file name="faq/databases.xml" person="webstudio" type="translation" date="11.05.2003"/> <file name="faq/general.xml" person="webstudio" type="translation" date="11.05.2003"/> <file name="faq/html.xml" person="webstudio" type="translation" date="11.05.2003"/> -<file name="reference/var/functions/is-null.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-numeric.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-resource.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-scalar.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/print-r.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/serialize.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/unserialize.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/var-dump.xml" person="lboshell" type="translation" date="06.10.2003"/> Index: phpdoc-es/reference/var/functions/is-null.xml +++ phpdoc-es/reference/var/functions/is-null.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.35 --> <refentry id="function.is-null"> <refnamediv> <refname>is_null</refname> <refpurpose> Encuentra si una variable es &null; </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_null</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> Devuelve &true; si <parameter>var</parameter> es <type>null</type>, o &false; en cualquier otro caso. </para> <para> Consulte sobre el tipo <link linkend="language.types.null.syntax">&null;</link> para una explicación de cuándo una variable es considerada como &null; y cuándo no. </para> <para> Vea también <link linkend="language.types.null.syntax">&null;</link>, <function>is_bool</function>, <function>is_numeric</function>, <function>is_float</function>, <function>is_int</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, <function>is_integer</function>, y <function>is_real</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 --> Index: phpdoc-es/reference/var/functions/is-numeric.xml +++ phpdoc-es/reference/var/functions/is-numeric.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.14 --> <refentry id="function.is-numeric"> <refnamediv> <refname>is_numeric</refname> <refpurpose> Encuentra si una variable es un número o una cadena numérica </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_numeric</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> Devuelve &true; si <parameter>var</parameter> es un número o una cadena numérica, o &false; en cualquier otro caso. </para> <para> Vea también <function>is_bool</function>, <function>is_float</function>, <function>is_int</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, y <function>is_integer</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 --> Index: phpdoc-es/reference/var/functions/is-resource.xml +++ phpdoc-es/reference/var/functions/is-resource.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.19 --> <refentry id="function.is-resource"> <refnamediv> <refname>is_resource</refname> <refpurpose> Encuentra si una variable es un recurso </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_resource</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> <function>is_resource</function> devuelve &true; si la variable dada por el parámetro <parameter>var</parameter> es un <type>resource</type>, o de lo contrario devuelve &false;. </para> <para> <example> <title>uso de <function>is_resource</function></title> <programlisting role="php"> <![CDATA[ <?php $enlace_bd = @mysql_connect('localhost', 'mysql_user', 'mysql_pass'); if (!is_resource($enlace_bd)) { die('No pudo realizarse la conexión : ' . mysql_error()); } ?> ]]> </programlisting> </example> </para> <para> Vea la documentación sobre el tipo de datos <type>resource</type> para más información. </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 --> Index: phpdoc-es/reference/var/functions/is-scalar.xml +++ phpdoc-es/reference/var/functions/is-scalar.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.35 --> <refentry id="function.is-scalar"> <refnamediv> <refname>is_scalar</refname> <refpurpose> Encuentra si una variable es un escalar </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_scalar</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> <function>is_scalar</function> devuelve &true; si la variable dada por el parámetro <parameter>var</parameter> es un escalar, o de lo contrario devuelve &false;. </para> <para> Las variables escalares son aquellas que contienen un <type>integer</type>, <type>float</type>, <type>string</type> o <type>boolean</type>. Los tipos <type>array</type>, <type>object</type> y <type>resource</type> no son escalares. <informalexample> <programlisting role="php"> <!-- TODO: better example, this one can be quite misleading for unexperienced programmers. --> <![CDATA[ <?php function mostrar_var($var) { if (is_scalar($var)) { echo $var; } else { var_dump($var); } } $pi = 3.1416; $proteinas = array("hemoglobina", "citocromo c oxidasa", "ferredoxin"); mostrar_var($pi); // imprime: 3.1416 mostrar_var($proteinas) // imprime: // array(3) { // [0]=> // string(10) "hemoglobina" // [1]=> // string(20) "citocromo c oxidasa" // [2]=> // string(10) "ferredoxin" // } ?> ]]> </programlisting> </informalexample> </para> <note> <para> <function>is_scalar</function> no considera los valores de tipo <type>resource</type> como escalares dado que los recursos son tipos de datos abstractos que por el momento están basados en enteros. Este detalle de implementación no debería ser considerado confiable, ya que puede cambiar. </para> </note> <para> Vea también <function>is_bool</function>, <function>is_numeric</function>, <function>is_float</function>, <function>is_int</function>, <function>is_real</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, y <function>is_integer</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 --> Index: phpdoc-es/reference/var/functions/print-r.xml +++ phpdoc-es/reference/var/functions/print-r.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.5 --> <refentry id="function.print-r"> <refnamediv> <refname>print_r</refname> <refpurpose> Imprime información legible para humanos sobre una variable </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>print_r</methodname> <methodparam><type>mixed</type><parameter>expresion</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>devolver</parameter></methodparam> </methodsynopsis> <note> <simpara> El parámetro <parameter>devolver</parameter> fue agregado en PHP 4.3.0 </simpara> </note> <simpara> <function>print_r</function> despliega información sobre una variable en una forma que es apta para su lectura por humanos. Si se le entrega una variable tipo <type>string</type>, <type>integer</type> o <type>float</type>, el valor mismo será impreso. Si se le entrega un <type>array</type>, los valores serán presentados en un formato que muestra las claves y los elementos. Una notación parecida es usada para variables tipo <type>object</type>. </simpara> <simpara> Recuerde que <function>print_r</function> desplazará el apuntador de la matriz al final. Use <function>reset</function> para llevarlo de vuelta al comienzo. </simpara> <para> <informalexample> <programlisting role="php"> <![CDATA[ <pre> <?php $a = array ('a' => 'manzana', 'b' => 'banano', 'c' => array ('x','y','z')); print_r ($a); ?> </pre> ]]> </programlisting> <para> Lo cual producirá la salida: </para> <screen> <![CDATA[ <pre> Array ( [a] => manzana [b] => banano [c] => Array ( [0] => x [1] => y [2] => z ) ) </pre> ]]> </screen> </informalexample> </para> <para> Si quisiera capturar la salida de <function>print_r</function>, use el parámetro <parameter>devolver</parameter>. Si este parámetro recibe el valor &true;, <function>print_r</function> devolverá su salida, en lugar de imprimirla (cosa que hace por defecto). </para> <para> <example> <title>Ejemplo del parámetro <parameter>devolver</parameter></title> <programlisting role="php"> <![CDATA[ <?php $b = array ('m' => 'mono', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $resultados = print_r ($b, true); // $resultados contiene ahora la salida de print_r ?> ]]> </programlisting> </example> </para> <note> <simpara> Si necesita capturar la salida de <function>print_r</function> con una versión de PHP anterior a 4.3.0, use las <link linkend="ref.outcontrol">funciones de control de salida</link>. </simpara> </note> <note> <simpara> Antes de PHP 4.0.4, <function>print_r</function> continuará ejecutándose indefinidamente si se le entrega una variable tipo <type>array</type> u <type>object</type> que contenga una referencia directa o indirecta a sí misma. Un ejemplo es <literal>print_r($GLOBALS)</literal> ya que la variable <literal>$GLOBALS</literal> es una variable global que contiene una referencia a sí misma. </simpara> </note> <simpara> Vea también <function>ob_start</function>, <function>var_dump</function> y <function>var_export</function>. </simpara> </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 -->
Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.67 phpdoc-es/translation.xml:1.68 --- phpdoc-es/translation.xml:1.67 Wed Oct 15 19:53:49 2003 +++ phpdoc-es/translation.xml Sat Oct 18 11:44:16 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.67 $ --> +<!-- $Revision: 1.68 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -9,7 +9,7 @@ him a mail at rafael@php.net or visit <a href="http://www.linux-es.com/PHP/">http://www.linux-es.com/PHP/</a>. </intro> <translators> -<person name="Rafael Martinez" email=" rafael@php.net" nick="rafael" cvs="yes"/> +<person name="Rafael Martinez" email="rafael@php.net" nick="rafael" cvs="yes"/> <person name="Leonardo Boshell" email="lboshell@php.net" nick="lboshell" cvs="yes"/> <person name="Robert Sánchez" email="reven@php.net" nick="reven" cvs="yes"/> <person name="Pablo Daniel Rigazzi" email="webstudio@php.net" nick="webstudio" cvs="yes"/> @@ -32,11 +32,6 @@ <file name="faq/databases.xml" person="webstudio" type="translation" date="11.05.2003"/> <file name="faq/general.xml" person="webstudio" type="translation" date="11.05.2003"/> <file name="faq/html.xml" person="webstudio" type="translation" date="11.05.2003"/> -<file name="reference/var/functions/is-null.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-numeric.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-resource.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/is-scalar.xml" person="lboshell" type="translation" date="06.10.2003"/> -<file name="reference/var/functions/print-r.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/serialize.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/unserialize.xml" person="lboshell" type="translation" date="06.10.2003"/> <file name="reference/var/functions/var-dump.xml" person="lboshell" type="translation" date="06.10.2003"/> Index: phpdoc-es/reference/var/functions/is-null.xml +++ phpdoc-es/reference/var/functions/is-null.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.35 --> <refentry id="function.is-null"> <refnamediv> <refname>is_null</refname> <refpurpose> Encuentra si una variable es &null; </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_null</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> Devuelve &true; si <parameter>var</parameter> es <type>null</type>, o &false; en cualquier otro caso. </para> <para> Consulte sobre el tipo <link linkend="language.types.null.syntax">&null;</link> para una explicación de cuándo una variable es considerada como &null; y cuándo no. </para> <para> Vea también <link linkend="language.types.null.syntax">&null;</link>, <function>is_bool</function>, <function>is_numeric</function>, <function>is_float</function>, <function>is_int</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, <function>is_integer</function>, y <function>is_real</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 --> Index: phpdoc-es/reference/var/functions/is-numeric.xml +++ phpdoc-es/reference/var/functions/is-numeric.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.14 --> <refentry id="function.is-numeric"> <refnamediv> <refname>is_numeric</refname> <refpurpose> Encuentra si una variable es un número o una cadena numérica </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_numeric</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> Devuelve &true; si <parameter>var</parameter> es un número o una cadena numérica, o &false; en cualquier otro caso. </para> <para> Vea también <function>is_bool</function>, <function>is_float</function>, <function>is_int</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, y <function>is_integer</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 --> Index: phpdoc-es/reference/var/functions/is-resource.xml +++ phpdoc-es/reference/var/functions/is-resource.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.19 --> <refentry id="function.is-resource"> <refnamediv> <refname>is_resource</refname> <refpurpose> Encuentra si una variable es un recurso </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_resource</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> <function>is_resource</function> devuelve &true; si la variable dada por el parámetro <parameter>var</parameter> es un <type>resource</type>, o de lo contrario devuelve &false;. </para> <para> <example> <title>uso de <function>is_resource</function></title> <programlisting role="php"> <![CDATA[ <?php $enlace_bd = @mysql_connect('localhost', 'mysql_user', 'mysql_pass'); if (!is_resource($enlace_bd)) { die('No pudo realizarse la conexión : ' . mysql_error()); } ?> ]]> </programlisting> </example> </para> <para> Vea la documentación sobre el tipo de datos <type>resource</type> para más información. </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 --> Index: phpdoc-es/reference/var/functions/is-scalar.xml +++ phpdoc-es/reference/var/functions/is-scalar.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.35 --> <refentry id="function.is-scalar"> <refnamediv> <refname>is_scalar</refname> <refpurpose> Encuentra si una variable es un escalar </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>is_scalar</methodname> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> <function>is_scalar</function> devuelve &true; si la variable dada por el parámetro <parameter>var</parameter> es un escalar, o de lo contrario devuelve &false;. </para> <para> Las variables escalares son aquellas que contienen un <type>integer</type>, <type>float</type>, <type>string</type> o <type>boolean</type>. Los tipos <type>array</type>, <type>object</type> y <type>resource</type> no son escalares. <informalexample> <programlisting role="php"> <!-- TODO: better example, this one can be quite misleading for unexperienced programmers. --> <![CDATA[ <?php function mostrar_var($var) { if (is_scalar($var)) { echo $var; } else { var_dump($var); } } $pi = 3.1416; $proteinas = array("hemoglobina", "citocromo c oxidasa", "ferredoxin"); mostrar_var($pi); // imprime: 3.1416 mostrar_var($proteinas) // imprime: // array(3) { // [0]=> // string(10) "hemoglobina" // [1]=> // string(20) "citocromo c oxidasa" // [2]=> // string(10) "ferredoxin" // } ?> ]]> </programlisting> </informalexample> </para> <note> <para> <function>is_scalar</function> no considera los valores de tipo <type>resource</type> como escalares dado que los recursos son tipos de datos abstractos que por el momento están basados en enteros. Este detalle de implementación no debería ser considerado confiable, ya que puede cambiar. </para> </note> <para> Vea también <function>is_bool</function>, <function>is_numeric</function>, <function>is_float</function>, <function>is_int</function>, <function>is_real</function>, <function>is_string</function>, <function>is_object</function>, <function>is_array</function>, y <function>is_integer</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 --> Index: phpdoc-es/reference/var/functions/print-r.xml +++ phpdoc-es/reference/var/functions/print-r.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/var.xml, last change in rev 1.5 --> <refentry id="function.print-r"> <refnamediv> <refname>print_r</refname> <refpurpose> Imprime información legible para humanos sobre una variable </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>bool</type><methodname>print_r</methodname> <methodparam><type>mixed</type><parameter>expresion</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>devolver</parameter></methodparam> </methodsynopsis> <note> <simpara> El parámetro <parameter>devolver</parameter> fue agregado en PHP 4.3.0 </simpara> </note> <simpara> <function>print_r</function> despliega información sobre una variable en una forma que es apta para su lectura por humanos. Si se le entrega una variable tipo <type>string</type>, <type>integer</type> o <type>float</type>, el valor mismo será impreso. Si se le entrega un <type>array</type>, los valores serán presentados en un formato que muestra las claves y los elementos. Una notación parecida es usada para variables tipo <type>object</type>. </simpara> <simpara> Recuerde que <function>print_r</function> desplazará el apuntador de la matriz al final. Use <function>reset</function> para llevarlo de vuelta al comienzo. </simpara> <para> <informalexample> <programlisting role="php"> <![CDATA[ <pre> <?php $a = array ('a' => 'manzana', 'b' => 'banano', 'c' => array ('x','y','z')); print_r ($a); ?> </pre> ]]> </programlisting> <para> Lo cual producirá la salida: </para> <screen> <![CDATA[ <pre> Array ( [a] => manzana [b] => banano [c] => Array ( [0] => x [1] => y [2] => z ) ) </pre> ]]> </screen> </informalexample> </para> <para> Si quisiera capturar la salida de <function>print_r</function>, use el parámetro <parameter>devolver</parameter>. Si este parámetro recibe el valor &true;, <function>print_r</function> devolverá su salida, en lugar de imprimirla (cosa que hace por defecto). </para> <para> <example> <title>Ejemplo del parámetro <parameter>devolver</parameter></title> <programlisting role="php"> <![CDATA[ <?php $b = array ('m' => 'mono', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $resultados = print_r ($b, true); // $resultados contiene ahora la salida de print_r ?> ]]> </programlisting> </example> </para> <note> <simpara> Si necesita capturar la salida de <function>print_r</function> con una versión de PHP anterior a 4.3.0, use las <link linkend="ref.outcontrol">funciones de control de salida</link>. </simpara> </note> <note> <simpara> Antes de PHP 4.0.4, <function>print_r</function> continuará ejecutándose indefinidamente si se le entrega una variable tipo <type>array</type> u <type>object</type> que contenga una referencia directa o indirecta a sí misma. Un ejemplo es <literal>print_r($GLOBALS)</literal> ya que la variable <literal>$GLOBALS</literal> es una variable global que contiene una referencia a sí misma. </simpara> </note> <simpara> Vea también <function>ob_start</function>, <function>var_dump</function> y <function>var_export</function>. </simpara> </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 -->