打印 htmlspecialchars 函数使用的转换表:
<?php
print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default.
?>
亲自试一试 »
get_html_translation_table() 函数返回使用的翻译表html实体()和htmlspecialchars()功能。
提示:某些字符可以采用多种方式进行编码。 get_html_translation_table() 函数返回最常见的编码。
get_html_translation_table(
function,flags,character-set)
Parameter | Description |
---|---|
function | Optional. Specifies which translation table to return. Possible values:
|
flags | Optional. Specifies which quotes the table will contain and which document type the table is for. The available quote styles are:
Additional flags for specifying which doctype the table is for:
|
character-set | Optional. A string that specifies which character-set to use. Allowed values are:
Note: Unrecognized character-sets will be ignored and replaced by ISO-8859-1 in versions prior to PHP 5.4. As of PHP 5.4, it will be ignored an replaced by UTF-8. |
返回值: | 以数组形式返回翻译表,其中原始字符作为键,实体作为值 |
---|---|
PHP 版本: | 4+ |
变更日志: | 默认值字符集PHP 5 中参数更改为 UTF-8 用于指定该表适用于哪种文档类型的附加标志; PHP 5.4 中添加了 ENT_HTML401、ENT_HTML5、ENT_XML1 和 ENT_XHTML 这个字符集PHP 5.3.4 中添加了参数 |
HTML_SPECIALCHARS 表:
<?php
print_r (get_html_translation_table(HTML_SPECIALCHARS));
?>
显示角色和实体名称:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
)
HTML_ENTITIES 表:
<?php
print_r (get_html_translation_table(HTML_ENTITIES));
?>
显示角色和实体名称:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
[ ] =>
[¡] => ¡
[¢] => ¢
[£] => £
[¤] => ¤
[¥] => ¥
[¦] => ¦
[§] => §
[¨] => ¨
[©] => ©
[ª] => ª
[«] => «
[¬] => ¬
[�] => ­
[®] => ®
[¯] => ¯
[°] => °
[±] => ±
[²] => ²
[³] => ³
[´] => ´
[µ] => µ
[¶] => ¶
[·] => ·
[¸] => ¸
[¹] => ¹
[º] => º
[»] => »
[¼] => ¼
[½] => ½
[¾] => ¾
[¿] => ¿
[À] => À
[Á] => Á
[Â] => Â
[Ã] => Ã
[Ä] => Ä
[Å] => Å
[Æ] => Æ
[Ç] => Ç
[È] => È
[É] => É
[Ê] => Ê
[Ë] => Ë
[Ì] => Ì
[Í] => Í
[Î] => Î
[Ï] => Ï
[Ð] => Ð
[Ñ] => Ñ
[Ò] => Ò
[Ó] => Ó
[Ô] => Ô
[Õ] => Õ
[Ö] => Ö
[×] => ×
[Ø] => Ø
[Ù] => Ù
[Ú] => Ú
[Û] => Û
[Ü] => Ü
[Ý] => Ý
[Þ] => Þ
[ß] => ß
[à] => à
[á] => á
[â] => â
[ã] => ã
[ä] => ä
[å] => å
[æ] => æ
[ç] => ç
[è] => è
[é] => é
[ê] => ê
[ë] => ë
[ì] => ì
[í] => í
[î] => î
[ï] => ï
[ð] => ð
[ñ] => ñ
[ò] => ò
[ó] => ó
[ô] => ô
[õ] => õ
[ö] => ö
[÷] => ÷
[ø] => ø
[ù] => ù
[ú] => ú
[û] => û
[ü] => ü
[ý] => ý
[þ] => þ
[ÿ] => ÿ
[Œ] => Œ
[œ] => œ
[Š] => Š
[š] => š
[Ÿ] => Ÿ
[ƒ] => ƒ
[ˆ] => ˆ
[˜] => ˜
[Α] => Α
[Β] => Β
[Γ] => Γ
[Δ] => Δ
[Ε] => Ε
[Ζ] => Ζ
[Η] => Η
[Θ] => Θ
[Ι] => Ι
[Κ] => Κ
[Λ] => Λ
[Μ] => Μ
[Ν] => Ν
[Ξ] => Ξ
[Ο] => Ο
[Π] => Π
[Ρ] => Ρ
[Σ] => Σ
[Τ] => Τ
[Υ] => Υ
[Φ] => Φ
[Χ] => Χ
[Ψ] => Ψ
[Ω] => Ω
[α] => α
[β] => β
[γ] => γ
[δ] => δ
[ε] => ε
[ζ] => ζ
[η] => η
[θ] => θ
[ι] => ι
[κ] => κ
[λ] => λ
[μ] => μ
[ν] => ν
[ξ] => ξ
[ο] => ο
[π] => π
[ρ] => ρ
[ς] => ς
[σ] => σ
[τ] => τ
[υ] => υ
[φ] => φ
[χ] => χ
[ψ] => ψ
[ω] => ω
[ϑ] => ϑ
[ϒ] => ϒ
[ϖ] => ϖ
[ ] =>  
[ ] =>  
[ ] =>  
[] => ‌
[] => ‍
[] => ‎
[] => ‏
[–] => –
[—] => —
[‘] => ‘
[’] => ’
[‚] => ‚
[“] => “
[”] => ”
[„] => „
[†] => †
[‡] => ‡
[•] => •
[…] => …
[‰] => ‰
[′] => ′
[″] => ″
[‹] => ‹
[›] => ›
[‾] => ‾
[⁄] => ⁄
[€] => €
[ℑ] => ℑ
[℘] => ℘
[ℜ] => ℜ
[™] => ™
[ℵ] => ℵ
[←] => ←
[↑] => ↑
[→] => →
[↓] => ↓
[↔] => ↔
[↵] => ↵
[⇐] => ⇐
[⇑] => ⇑
[⇒] => ⇒
[⇓] => ⇓
[⇔] => ⇔
[∀] => ∀
[∂] => ∂
[∃] => ∃
[∅] => ∅
[∇] => ∇
[∈] => ∈
[∉] => ∉
[∋] => ∋
[∏] => ∏
[∑] => ∑
[−] => −
[∗] => ∗
[√] => √
[∝] => ∝
[∞] => ∞
[∠] => ∠
[∧] => ∧
[∨] => ∨
[∩] => ∩
[∪] => ∪
[∫] => ∫
[∴] => ∴
[∼] => ∼
[≅] => ≅
[≈] => ≈
[≠] => ≠
[≡] => ≡
[≤] => ≤
[≥] => ≥
[⊂] => ⊂
[⊃] => ⊃
[⊄] => ⊄
[⊆] => ⊆
[⊇] => ⊇
[⊕] => ⊕
[⊗] => ⊗
[⊥] => ⊥
[⋅] => ⋅
[⌈] => ⌈
[⌉] => ⌉
[⌊] => ⌊
[⌋] => ⌋
[〈] => ⟨
[〉] => ⟩
[◊] => ◊
[♠] => ♠
[♣] => ♣
[♥] => ♥
[♦] => ♦
)
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!