Name

get_html_translation_table

Synopsis

array get_html_translation_table([int which[, int style[, string encoding]]])

Returns the translation table used by either htmlspecialchars() or htmlentities(). If which is HTML_ENTITIES, the table used by htmlentities() is returned; if which is HTML_SPECIALCHARS, the table used by htmlspecialchars() is returned. Optionally, you can specify which quotes style you want returned; the possible values are the same as those in the translation functions:

ENT_COMPAT (default)

Converts double quotes, but not single quotes

ENT_NOQUOTES

Does not convert either double quotes or single quotes

ENT_QUOTES

Converts both single and double quotes

ENT_HTML401

Table for HTML 4.01 entities

ENT_XML1

Table for XML 1 entities

ENT_XHTML

Table for XHTML entities

ENT_HTML5

Table for HTML 5 entities

The encoding optional parameter has the following possible selections:

ISO-8859-1

Western European, Latin-1.

ISO-8859-5

Cyrillic charset (Latin/Cyrillic), rarely used.

ISO-8859-15

Western European, Latin-9. Adds the Euro sign, French and Finnish letters missing in Latin-1.

UTF-8

ASCII compatible multibyte 8-bit Unicode.

cp866

DOS-specific Cyrillic charset.

cp1251

Windows-specific Cyrillic charset.

cp1252

Windows-specific charset for Western European.

KOI8-R

Russian.

BIG5

Traditional Chinese, mainly used in Taiwan.

GB2312

Simplified Chinese, national standard character set.

BIG5-HKSCS

Big5 with Hong Kong extensions, Traditional Chinese.

Shift_JIS

Japanese.

EUC-JP

Japanese.

MacRoman

Charset that was used by Mac OS.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.