reference/strings/functions/html-entity-decode.xml
eabde0419cf90f596f60db00e31fcb6ebe41ac55
...
...
@@ -1,9 +1,9 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.html-entity-decode">
3
+
<refentry xml:id="function.html-entity-decode" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>html_entity_decode</refname>
6
-
<refpurpose>Convert all HTML entities to their applicable characters</refpurpose>
6
+
<refpurpose>Convert HTML entities to their corresponding characters</refpurpose>
7
7
</refnamediv>
8
8
9
9
<refsect1 role="description">
...
...
@@ -11,13 +11,13 @@
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>html_entity_decode</methodname>
13
13
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ENT_COMPAT | ENT_HTML401</initializer></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>ini_get("default_charset")</initializer></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
<function>html_entity_decode</function> is the opposite of
19
-
<function>htmlentities</function> in that it converts all HTML entities
20
-
in the <parameter>string</parameter> to their applicable characters.
19
+
<function>htmlentities</function> in that it converts HTML entities
20
+
in the <parameter>string</parameter> to their corresponding characters.
21
21
</para>
22
22
<para>
23
23
More precisely, this function decodes all the entities (including all numeric
...
...
@@ -46,7 +46,7 @@
46
46
<listitem>
47
47
<para>
48
48
A bitmask of one or more of the following flags, which specify how to handle quotes and
49
-
which document type to use. The default is <literal>ENT_COMPAT | ENT_HTML401</literal>.
49
+
which document type to use. The default is <literal>ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401</literal>.
50
50
<table>
51
51
<title>Available <parameter>flags</parameter> constants</title>
52
52
<tgroup cols="2">
...
...
@@ -70,6 +70,13 @@
70
70
<entry>Will leave both double and single quotes unconverted.</entry>
71
71
</row>
72
72
<row>
73
+
<entry><constant>ENT_SUBSTITUTE</constant></entry>
74
+
<entry>
75
+
Replace invalid code unit sequences with a Unicode Replacement Character
76
+
U+FFFD (UTF-8) or &amp;#xFFFD; (otherwise) instead of returning an empty string.
77
+
</entry>
78
+
</row>
79
+
<row>
73
80
<entry><constant>ENT_HTML401</constant></entry>
74
81
<entry>
75
82
Handle code as HTML 4.01.
...
...
@@ -119,34 +126,30 @@
119
126

120
127
<refsect1 role="changelog">
121
128
&reftitle.changelog;
122
-
<para>
123
-
<informaltable>
124
-
<tgroup cols="2">
125
-
<thead>
126
-
<row>
127
-
<entry>&Version;</entry>
128
-
<entry>&Description;</entry>
129
-
</row>
130
-
</thead>
131
-
<tbody>
132
-
&strings.changelog.encoding;
133
-
<row>
134
-
<entry>5.4.0</entry>
135
-
<entry>
136
-
Default encoding changed from ISO-8859-1 to UTF-8.
137
-
</entry>
138
-
</row>
139
-
<row>
140
-
<entry>5.4.0</entry>
141
-
<entry>
142
-
The constants <constant>ENT_HTML401</constant>, <constant>ENT_XML1</constant>,
143
-
<constant>ENT_XHTML</constant> and <constant>ENT_HTML5</constant> were added.
144
-
</entry>
145
-
</row>
146
-
</tbody>
147
-
</tgroup>
148
-
</informaltable>
149
-
</para>
129
+
<informaltable>
130
+
<tgroup cols="2">
131
+
<thead>
132
+
<row>
133
+
<entry>&Version;</entry>
134
+
<entry>&Description;</entry>
135
+
</row>
136
+
</thead>
137
+
<tbody>
138
+
<row>
139
+
<entry>8.1.0</entry>
140
+
<entry>
141
+
<parameter>flags</parameter> changed from <constant>ENT_COMPAT</constant> to <constant>ENT_QUOTES</constant> | <constant>ENT_SUBSTITUTE</constant> | <constant>ENT_HTML401</constant>.
142
+
</entry>
143
+
</row>
144
+
<row>
145
+
<entry>8.0.0</entry>
146
+
<entry>
147
+
<parameter>encoding</parameter> is nullable now.
148
+
</entry>
149
+
</row>
150
+
</tbody>
151
+
</tgroup>
152
+
</informaltable>
150
153
</refsect1>
151
154

152
155
<refsect1 role="examples">
...
...
@@ -199,7 +202,6 @@ echo $b; // I'll "walk" the <b>dog</b> now
199
202
</refsect1>
200
203

201
204
</refentry>
202
-

203
205
<!-- Keep this comment at the end of the file
204
206
Local variables:
205
207
mode: sgml
206
208