mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
aa2db200ab
commit
c78ed10a19
1 changed files with 12 additions and 20 deletions
|
@ -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>&quot;</literal>,
|
||||
<literal>&#34;</literal> or <literal>&#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; &lt;Frau&gt; &amp;
|
||||
Kr&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 &
|
||||
<Frau> & Krä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>
|
||||
|
|
Loading…
Reference in a new issue