cvs: phpdoc /en/reference/strings/functions htmlentities.xml
| From: | Andrew Lindeman | Date: | Sat, 27 Apr 2002 21:56:53 +0000 |
| Subject: | cvs: phpdoc /en/reference/strings/functions htmlentities.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969344950@lists.php.net to get a copy of this message | ||
alindeman Sat Apr 27 17:56:53 2002 EDT
Modified files:
/phpdoc/en/reference/strings/functions htmlentities.xml
Log:
fixing bug #12379
Index: phpdoc/en/reference/strings/functions/htmlentities.xml
diff -u phpdoc/en/reference/strings/functions/htmlentities.xml:1.2
phpdoc/en/reference/strings/functions/htmlentities.xml:1.3
--- phpdoc/en/reference/strings/functions/htmlentities.xml:1.2 Wed Apr 17 02:44:15 2002
+++ phpdoc/en/reference/strings/functions/htmlentities.xml Sat Apr 27 17:56:53 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.htmlentities">
<refnamediv>
@@ -39,6 +39,25 @@
third argument which defines character set used in conversion.
Support for this argument was added in PHP 4.1.0.
</para>
+ <para>
+ There is no reverse of this function. However, you can create one on your
+ own. Here is an example of how to do this.
+ </para>
+ <example>
+ <title>Reverse of <function>htmlentities</function></title>
+ <programlisting role="php">
+<[!CDATA[
+<?php
+function unhtmlentities ($string)
+{
+ $trans_tbl = get_html_translation_table (HTML_ENTITIES);
+ $trans_tbl = array_flib ($trans_tbl);
+ return strtr ($string, $trans_tbl);
+}
+?>
+]]>
+ </programlisting>
+ </example>
<para>
See also <function>htmlspecialchars</function> and
<function>nl2br</function>.