reference/strings/functions/htmlentities.xml
840ed22479a110ab63bce0fa75d5f3c41642b8e3
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.htmlentities" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
<refentry xml:id="function.htmlentities" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>htmlentities</refname>
6
6
<refpurpose>Convert all applicable characters to HTML entities</refpurpose>
...
...
@@ -11,14 +11,17 @@
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>htmlentities</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
<methodparam choice="opt"><type>bool</type><parameter>double_encode</parameter><initializer>&true;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
This function is identical to <function>htmlspecialchars</function> in all
20
20
ways, except with <function>htmlentities</function>, all characters which
21
21
have HTML character entity equivalents are translated into these entities.
22
+
The <function>get_html_translation_table</function> function can be used
23
+
to return the translation table used dependent upon the provided
24
+
<parameter>flags</parameter> constants.
22
25
</para>
23
26
<para>
24
27
If you want to decode instead (the reverse) you can use
...
...
@@ -44,7 +47,7 @@
44
47
<para>
45
48
A bitmask of one or more of the following flags, which specify how to handle quotes,
46
49
invalid code unit sequences and the used document type. The default is
47
-
<literal>ENT_COMPAT | ENT_HTML401</literal>.
50
+
<literal>ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401</literal>.
48
51
<table>
49
52
<title>Available <parameter>flags</parameter> constants</title>
50
53
<tgroup cols="2">
...
...
@@ -157,48 +160,30 @@
157
160

158
161
<refsect1 role="changelog">
159
162
&reftitle.changelog;
160
-
<para>
161
-
<informaltable>
162
-
<tgroup cols="2">
163
-
<thead>
164
-
<row>
165
-
<entry>&Version;</entry>
166
-
<entry>&Description;</entry>
167
-
</row>
168
-
</thead>
169
-
<tbody>
170
-
&strings.changelog.encoding;
171
-
<row>
172
-
<entry>5.4.0</entry>
173
-
<entry>
174
-
The default value for the <parameter>encoding</parameter> parameter was
175
-
changed to UTF-8.
176
-
</entry>
177
-
</row>
178
-
<row>
179
-
<entry>5.4.0</entry>
180
-
<entry>
181
-
The constants <constant>ENT_SUBSTITUTE</constant>, <constant>ENT_DISALLOWED</constant>,
182
-
<constant>ENT_HTML401</constant>, <constant>ENT_XML1</constant>,
183
-
<constant>ENT_XHTML</constant> and <constant>ENT_HTML5</constant> were added.
184
-
</entry>
185
-
</row>
186
-
<row>
187
-
<entry>5.3.0</entry>
188
-
<entry>
189
-
The constant <constant>ENT_IGNORE</constant> was added.
190
-
</entry>
191
-
</row>
192
-
<row>
193
-
<entry>5.2.3</entry>
194
-
<entry>
195
-
The <parameter>double_encode</parameter> parameter was added.
196
-
</entry>
197
-
</row>
198
-
</tbody>
199
-
</tgroup>
200
-
</informaltable>
201
-
</para>
163
+
<informaltable>
164
+
<tgroup cols="2">
165
+
<thead>
166
+
<row>
167
+
<entry>&Version;</entry>
168
+
<entry>&Description;</entry>
169
+
</row>
170
+
</thead>
171
+
<tbody>
172
+
<row>
173
+
<entry>8.1.0</entry>
174
+
<entry>
175
+
<parameter>flags</parameter> changed from <constant>ENT_COMPAT</constant> to <constant>ENT_QUOTES</constant> | <constant>ENT_SUBSTITUTE</constant> | <constant>ENT_HTML401</constant>.
176
+
</entry>
177
+
</row>
178
+
<row>
179
+
<entry>8.0.0</entry>
180
+
<entry>
181
+
<parameter>encoding</parameter> is nullable now.
182
+
</entry>
183
+
</row>
184
+
</tbody>
185
+
</tgroup>
186
+
</informaltable>
202
187
</refsect1>
203
188

204
189
<refsect1 role="examples">
...
...
@@ -256,7 +241,6 @@ echo htmlentities($str, ENT_QUOTES | ENT_IGNORE, "UTF-8");
256
241
</refsect1>
257
242

258
243
</refentry>
259
-

260
244
<!-- Keep this comment at the end of the file
261
245
Local variables:
262
246
mode: sgml
263
247