cvs: phpdoc-es /reference/strings/functions htmlentities.xml
| From: | Enrique Garcia Briones | 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ó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ón es del todo idéntica a
<function>htmlspecialchars</function>,
- excepto que traduce todos los caracteres que tienen equivalente
- como entidad HTML.
+ Esta funció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án cambiados a esas entidades.
</para>
<para>
- Actualmente se utiliza el juego de caracteres ISO-8859-1.
+ En <function>htmlspecialchars</function>, el parámetro opcional
+ <parameter>quote_style</parameter> le permite definir lo que será
+ 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ón</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><constant>ENT_COMPAT</constant></entry>
+ <entry>Convertirá las dobles comillas y dejará solo las
+ comillas sencillas.</entry>
+ </row>
+ <row>
+ <entry><constant>ENT_QUOTES</constant></entry>
+ <entry>Convertirá las comillas dobles y sencillas.</entry>
+ </row>
+ <row>
+ <entry><constant>ENT_NOQUOTES</constant></entry>
+ <entry>Mantendrá las comillas dobles y sencillas sin
cambios.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</para>
<para>
- Vea también <function>htmlspecialchars</function> y
- <function>nl2br</function>.
+ El parámetro opcional <parameter>quote</parameter> fue agregado en
+ PHP 4.0.3.
+ </para>
+ <para>
+ Además <function>htmlspecialchars</function>, tiene un tercer
+ parámetro opcional <parameter>charset</parameter> el cual define
+ el conjunto de caracteres que serán utilizados en la
+ conversión. Este pará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ó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 <b>bold</b>
+echo htmlentities($str);
+
+// Outputs: A 'quote' is <b>bold</b>
+echo htmlentities($str, ENT_QUOTES);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ Vea tambié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>