git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@80177 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andy Lindeman 2002-04-27 21:56:53 +00:00
parent bc97319672
commit 57714d4eb0

View file

@ -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>.