mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@326170 c90b9560-bf6c-de11-be94-00142212c4b1
138 lines
3.4 KiB
XML
138 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 84b8fca68fc762fefe85acde180a38b2e77a28b9 Maintainer: yago Status: ready -->
|
|
<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.print">
|
|
<refnamediv>
|
|
<refname>print</refname>
|
|
<refpurpose>Mostrar una cadena</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>print</methodname>
|
|
<methodparam><type>string</type><parameter>arg</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Muestra el parámetro <parameter>arg</parameter>.
|
|
</para>
|
|
<para>
|
|
<literal>print</literal> no es realmente una función (es un constructor de lenguaje)
|
|
por lo tanto no es necesario usar paréntesis
|
|
para indicar su lista de argumentos.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>arg</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Los datos de entrada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Siempre devuelve <literal>1</literal>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplos de <literal>print</literal></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
print("Hola mundo");
|
|
|
|
print "print() también funciona sin paréntesis.";
|
|
|
|
print "Esto separa
|
|
múltiples líneas. Los saltos de línea también
|
|
se mostrarán";
|
|
|
|
print "Esto separa\nmúltiples líneas. Los salos de línea también\nse mostrarán.";
|
|
|
|
print "para escapar caracteres se \"hace así\".";
|
|
|
|
// También se puede usar variables usando print
|
|
$foo = "foobar";
|
|
$bar = "barbaz";
|
|
|
|
print "foo es $foo"; // foo es foobar
|
|
|
|
// También se pueden usar arrays
|
|
$bar = array("value" => "foo");
|
|
|
|
print "Esto es {$bar['value']} !"; // Esto es foo !
|
|
|
|
// Al usar comillas simples se mostrará el nombre de la variable, no su valor
|
|
print 'foo is $foo'; // foo is $foo
|
|
|
|
// Si no se necesita mostrar otros caracteres, se puede simplemente mostrar variables
|
|
print $foo; // foobar
|
|
|
|
print <<<END
|
|
Este párrafo utiliza la sintaxis "here document" para mostrar
|
|
múltiples líneas con la interpolación de $variable. Nótese
|
|
que el terminador de here document debe aparecer al final
|
|
de la línea con punto y coma y ¡ningún espacio en blanco extra!
|
|
END;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.language-construct;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>echo</function></member>
|
|
<member><function>printf</function></member>
|
|
<member><function>flush</function></member>
|
|
<member><link linkend="language.types.string.syntax.heredoc">Sintaxis de Heredoc</link></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|