mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fixing bug #12379
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@80177 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
bc97319672
commit
57714d4eb0
1 changed files with 20 additions and 1 deletions
|
@ -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>.
|
||||
|
|
Loading…
Reference in a new issue