htmlspecialchars() & htmlentities() have a new optional friend

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@236122 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hannes Magnusson 2007-05-22 15:34:06 +00:00
parent 13a7469acc
commit 95b7889402
3 changed files with 31 additions and 8 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<appendix id="migration52">
<title>Migrating from PHP 5.1.x to PHP 5.2.x</title>
@ -536,6 +536,18 @@ $obj->getCommentName('');
<para>PHP Core:</para>
<itemizedlist>
<listitem>
<simpara>
<function>htmlentities</function>
- added <parameter>double_encode</parameter> in PHP 5.2.3.
</simpara>
</listitem>
<listitem>
<simpara>
<function>htmlspecialchars</function>
- added <parameter>double_encode</parameter> in PHP 5.2.3.
</simpara>
</listitem>
<listitem>
<simpara>
<function>base64_decode</function>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.htmlentities">
<refnamediv>
@ -15,6 +15,7 @@
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter></methodparam>
</methodsynopsis>
<para>
This function is identical to
@ -53,17 +54,21 @@
</tgroup>
</table>
</para>
<para>
Support for the optional <parameter>quote</parameter> parameter was
added in PHP 4.0.3.
</para>
<para>
Like <function>htmlspecialchars</function>, it takes an optional
third argument <parameter>charset</parameter> which defines character
set used in conversion. Support for this argument was added in PHP 4.1.0.
set used in conversion.
Presently, the ISO-8859-1 character set is used as the default.
</para>
&reference.strings.charsets;
<para>
When <parameter>double_encode</parameter> is turned off PHP will not
encode existing html entities. The default is to convert everything.
</para>
<para>The <parameter>double_quote</parameter> parameter was added in PHP 5.2.3,
<parameter>charset</parameter> in 4.1.0 and
<parameter>quote</parameter> in PHP 4.0.3.
</para>
<para>
If you're wanting to decode instead (the reverse) you can use
<function>html_entity_decode</function>.

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.htmlspecialchars">
<refnamediv>
@ -15,6 +15,7 @@
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter></methodparam>
</methodsynopsis>
<para>
Certain characters have special significance in HTML, and should
@ -91,6 +92,11 @@ echo $new; // &lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;
this third argument was added in PHP 4.1.0.
</para>
&reference.strings.charsets;
<para>
When <parameter>double_encode</parameter> is turned off PHP will not
encode existing html entities, the default is to convert everything.
This parameter was added in PHP 5.2.3.
</para>
<para>
See also <function>get_html_translation_table</function>,
<function>htmlspecialchars_decode</function>,