Returns only one form (bug #33553)

Remove duplicate example, add see also


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@190239 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2005-07-08 08:57:39 +00:00
parent aa2db200ab
commit c78ed10a19

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.get-html-translation-table">
<refnamediv>
@ -35,6 +35,15 @@
<constant>ENT_COMPAT</constant> mode. See the description of these modes in
<function>htmlspecialchars</function>.
</para>
<note>
<para>
Special characters can be encoded in several ways. E.g.
<literal>"</literal> can be encoded as <literal>&amp;quot;</literal>,
<literal>&amp;#34;</literal> or <literal>&amp;#x22</literal>.
<function>get_html_translation_table</function> returns only the most
common form for them.
</para>
</note>
<para>
<example>
<title>Translation Table Example</title>
@ -52,27 +61,10 @@ $encoded = strtr($str, $trans);
<literal>"Hallo &amp;amp; &amp;lt;Frau&amp;gt; &amp;amp;
Kr&amp;auml;mer".</literal>
</para>
<para>
Another interesting use of this function is to, with help of <function>array_flip</function>,
change the direction of the translation.
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
$trans = array_flip($trans);
$original = strtr($encoded, $trans);
?>
]]>
</programlisting>
</informalexample>
The content of <literal>$original</literal> would be: "Hallo &amp;
&lt;Frau> &amp; Kr&auml;mer".
</para>
<para>
See also <function>htmlspecialchars</function>,
<function>htmlentities</function>,
<function>strtr</function>, and
<function>array_flip</function>.
<function>htmlentities</function>, and
<function>html_entity_decode</function>.
</para>
</refsect1>
</refentry>