cvs: phpdoc-es /reference/strings/functions htmlentities.xml

From: Date: Sun, 10 Apr 2005 13:59:35 +0000
Subject: cvs: phpdoc-es /reference/strings/functions htmlentities.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-777@lists.php.net to get a copy of this message
baoengb Sun Apr 10 09:59:35 2005 EDT Modified files: /phpdoc-es/reference/strings/functions htmlentities.xml Log: Updated, as reported by: Luis Bononi, Thanks http://cvs.php.net/diff.php/phpdoc-es/reference/strings/functions/htmlentities.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/strings/functions/htmlentities.xml diff -u phpdoc-es/reference/strings/functions/htmlentities.xml:1.2 phpdoc-es/reference/strings/functions/htmlentities.xml:1.3 --- phpdoc-es/reference/strings/functions/htmlentities.xml:1.2 Sat Aug 17 09:04:36 2002 +++ phpdoc-es/reference/strings/functions/htmlentities.xml Sun Apr 10 09:59:35 2005 @@ -1,30 +1,100 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./es/functions/strings.xml, last change in rev 1.7 --> -<!-- last change to 'htmlentities' in en/ tree in rev 1.2 --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.10 Maintainer: baoengb Status: ready --> +<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.htmlentities"> <refnamediv> <refname>htmlentities</refname> <refpurpose> - Convierte todos los caracteres aplicables a entidades HTML + Convierte todos los caracteres a su entidad HTML aplicable </refpurpose> </refnamediv> <refsect1> <title>Descripci&oacute;n</title> <methodsynopsis> <type>string</type><methodname>htmlentities</methodname> - <methodparam><type>string</type><parameter>cadena</parameter></methodparam> + <methodparam><type>string</type><parameter>string</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam> </methodsynopsis> <para> - Esta funci&oacute;n es del todo id&eacute;ntica a <function>htmlspecialchars</function>, - excepto que traduce todos los caracteres que tienen equivalente - como entidad HTML. + Esta funci&oacute;n es identica en todo a + <function>htmlspecialchars</function>, excepto que con + <function>htmlentities</function>, todos los caracteres que tengan una + entidad equivalente en HTML ser&aacute;n cambiados a esas entidades. </para> <para> - Actualmente se utiliza el juego de caracteres ISO-8859-1. + En <function>htmlspecialchars</function>, el par&aacute;metro opcional + <parameter>quote_style</parameter> le permite definir lo que ser&aacute; + hecho con las comillas 'sencillas' y las "dobles". Toma uno de tres + constantes con <constant>ENT_COMPAT</constant>: + <table> + <title>Constantes disponibles para <parameter>quote_style</parameter></title> + <tgroup cols="2"> + <thead> + <row> + <entry>Nombre de Constante</entry> + <entry>Descripci&oacute;n</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>ENT_COMPAT</constant></entry> + <entry>Convertir&aacute; las dobles comillas y dejar&aacute; solo las + comillas sencillas.</entry> + </row> + <row> + <entry><constant>ENT_QUOTES</constant></entry> + <entry>Convertir&aacute; las comillas dobles y sencillas.</entry> + </row> + <row> + <entry><constant>ENT_NOQUOTES</constant></entry> + <entry>Mantendr&aacute; las comillas dobles y sencillas sin cambios.</entry> + </row> + </tbody> + </tgroup> + </table> </para> <para> - Vea tambi&eacute;n <function>htmlspecialchars</function> y - <function>nl2br</function>. + El par&aacute;metro opcional <parameter>quote</parameter> fue agregado en + PHP 4.0.3. + </para> + <para> + Adem&aacute;s <function>htmlspecialchars</function>, tiene un tercer + par&aacute;metro opcional <parameter>charset</parameter> el cual define + el conjunto de caracteres que ser&aacute;n utilizados en la + conversi&oacute;n. Este par&aacute;metro fue agregado en PHP 4.1.0. + Actualmente, el conjunto de caracteres IS-8859-1 es usado como valor + por defecto. + </para> + &reference.strings.charsets; + <para> + Si quiere hacer la operaci&oacute;n inversa puede usar + <function>html_entity_decode</function>. + </para> + <para> + <example> + <title>Un ejemplo de <function>htmlentities</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$str = "A 'quote' is <b>bold</b>"; + +// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt; +echo htmlentities($str); + +// Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt; +echo htmlentities($str, ENT_QUOTES); +?> +]]> + </programlisting> + </example> + </para> + <para> + Vea tambi&eacute;n <function>html_entity_decode</function>, + <function>get_html_translation_table</function>, + <function>htmlspecialchars</function>, <function>nl2br</function>, + y <function>urlencode</function>. </para> </refsect1> </refentry>

« previous php.doc.es (#777) next »