PHP get_html_translation_table() 函數(shù)
PHP get_html_translation_table() 函數(shù)
實例
輸出 htmlspecialchars 函數(shù)使用的翻譯表:
<?php
print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default.
?>
print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default.
?>
運行實例 ?
定義和用法
get_html_translation_table() 函數(shù)返回 htmlentities() 和 htmlspecialchars() 函數(shù)使用的翻譯表。
提示:一些字符可以按照若干種方式進行編碼。get_html_translation_table() 函數(shù)返回最普通的編碼。
語法
get_html_translation_table(function,flags,character-set)
參數(shù) | 描述 |
---|---|
function | 可選。規(guī)定返回哪個翻譯表。 可能的值:
|
flags | 可選。規(guī)定翻譯表將包含哪種引號以及翻譯表用于哪種文檔類型。
可用的引號類型:
規(guī)定翻譯表適用的文檔類型的附加 flags:
|
character-set | 可選。一個規(guī)定了要使用的字符集的字符串。 允許的值:
注釋:在 PHP 5.4 之前的版本,無法被識別的字符集將被忽略并由 ISO-8859-1 替代。自 PHP 5.4 起,無法被識別的字符集將被忽略并由 UTF-8 替代。 |
技術(shù)細節(jié)
返回值: | 以數(shù)組形式返回翻譯表,原始字符作為鍵名,實體作為鍵值。 |
---|---|
PHP 版本: | 4+ |
更新日志: | 在 PHP 5 中,character-set 參數(shù)的默認(rèn)值改為 UTF-8。 在 PHP 5.4 中,新增了用于規(guī)定翻譯表適用的文檔類型的附加 flags:ENT_HTML401、ENT_HTML5、ENT_XML1 和 ENT_XHTML。 在 PHP 5.3.4 中,新增了 character-set 參數(shù)。 |
更多實例
實例
HTML_SPECIALCHARS 的翻譯表:
<?php
print_r (get_html_translation_table(HTML_SPECIALCHARS));
?>
print_r (get_html_translation_table(HTML_SPECIALCHARS));
?>
Displaying character and entity name:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
)
(
["] => "
[&] => &
[<] => <
[>] => >
)
實例 2
HTML_ENTITIES 的翻譯表:
<?php
print_r (get_html_translation_table(HTML_ENTITIES));
?>
print_r (get_html_translation_table(HTML_ENTITIES));
?>
顯示字符及其對應(yīng)的實體名稱:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
[ ] =>
[?] => ¡
[¢] => ¢
[£] => £
[¤] => ¤
[¥] => ¥
[|] => ¦
[§] => §
[¨] => ¨
[?] => ©
[a] => ª
[?] => «
[?] => ¬
[-] => ­
[?] => ®
[ˉ] => ¯
[°] => °
[±] => ±
[2] => ²
[3] => ³
[′] => ´
[μ] => µ
[?] => ¶
[·] => ·
[?] => ¸
[1] => ¹
[o] => º
[?] => »
[?] => ¼
[?] => ½
[?] => ¾
[?] => ¿
[à] => À
[á] => Á
[?] => Â
[?] => Ã
[?] => Ä
[?] => Å
[?] => Æ
[?] => Ç
[è] => È
[é] => É
[ê] => Ê
[?] => Ë
[ì] => Ì
[í] => Í
[?] => Î
[?] => Ï
[D] => Ð
[?] => Ñ
[ò] => Ò
[ó] => Ó
[?] => Ô
[?] => Õ
[?] => Ö
[×] => ×
[?] => Ø
[ù] => Ù
[ú] => Ú
[?] => Û
[ü] => Ü
[Y] => Ý
[T] => Þ
[?] => ß
[à] => à
[á] => á
[a] => â
[?] => ã
[?] => ä
[?] => å
[?] => æ
[?] => ç
[è] => è
[é] => é
[ê] => ê
[?] => ë
[ì] => ì
[í] => í
[?] => î
[?] => ï
[e] => ð
[?] => ñ
[ò] => ò
[ó] => ó
[?] => ô
[?] => õ
[?] => ö
[÷] => ÷
[?] => ø
[ù] => ù
[ú] => ú
[?] => û
[ü] => ü
[y] => ý
[t] => þ
[?] => ÿ
[?] => Œ
[?] => œ
[?] => Š
[?] => š
[?] => Ÿ
[?] => ƒ
[?] => ˆ
[?] => ˜
[Α] => Α
[Β] => Β
[Γ] => Γ
[Δ] => Δ
[Ε] => Ε
[Ζ] => Ζ
[Η] => Η
[Θ] => Θ
[Ι] => Ι
[Κ] => Κ
[Λ] => Λ
[Μ] => Μ
[Ν] => Ν
[Ξ] => Ξ
[Ο] => Ο
[Π] => Π
[Ρ] => Ρ
[Σ] => Σ
[Τ] => Τ
[Υ] => Υ
[Φ] => Φ
[Χ] => Χ
[Ψ] => Ψ
[Ω] => Ω
[α] => α
[β] => β
[γ] => γ
[δ] => δ
[ε] => ε
[ζ] => ζ
[η] => η
[θ] => θ
[ι] => ι
[κ] => κ
[λ] => λ
[μ] => μ
[ν] => ν
[ξ] => ξ
[ο] => ο
[π] => π
[ρ] => ρ
[ς] => ς
[σ] => σ
[τ] => τ
[υ] => υ
[φ] => φ
[χ] => χ
[ψ] => ψ
[ω] => ω
[ϑ] => ϑ
[ϒ] => ϒ
[ϖ] => ϖ
[ ] =>  
[ ] =>  
[ ] =>  
[] => ‌
[] => ‍
[] => ‎
[] => ‏
[–] => –
[—] => —
['] => ‘
['] => ’
[?] => ‚
["] => “
["] => ”
[?] => „
[?] => †
[?] => ‡
[?] => •
[…] => …
[‰] => ‰
[′] => ′
[″] => ″
[?] => ‹
[?] => ›
[‾] => ‾
[⁄] => ⁄
[€] => €
[ℑ] => ℑ
[℘] => ℘
[ℜ] => ℜ
[?] => ™
[ℵ] => ℵ
[←] => ←
[↑] => ↑
[→] => →
[↓] => ↓
[↔] => ↔
[↵] => ↵
[⇐] => ⇐
[⇑] => ⇑
[⇒] => ⇒
[⇓] => ⇓
[⇔] => ⇔
[∀] => ∀
[∂] => ∂
[∃] => ∃
[∅] => ∅
[∇] => ∇
[∈] => ∈
[∉] => ∉
[∋] => ∋
[∏] => ∏
[∑] => ∑
[−] => −
[∗] => ∗
[√] => √
[∝] => ∝
[∞] => ∞
[∠] => ∠
[∧] => ∧
[∨] => ∨
[∩] => ∩
[∪] => ∪
[∫] => ∫
[∴] => ∴
[∼] => ∼
[≅] => ≅
[≈] => ≈
[≠] => ≠
[≡] => ≡
[≤] => ≤
[≥] => ≥
[⊂] => ⊂
[⊃] => ⊃
[⊄] => ⊄
[⊆] => ⊆
[⊇] => ⊇
[⊕] => ⊕
[⊗] => ⊗
[⊥] => ⊥
[⋅] => ⋅
[⌈] => ⌈
[⌉] => ⌉
[⌊] => ⌊
[⌋] => ⌋
[〈] => ⟨
[〉] => ⟩
[◊] => ◊
[♠] => ♠
[♣] => ♣
[♥] => ♥
[♦] => ♦
)
(
["] => "
[&] => &
[<] => <
[>] => >
[ ] =>
[?] => ¡
[¢] => ¢
[£] => £
[¤] => ¤
[¥] => ¥
[|] => ¦
[§] => §
[¨] => ¨
[?] => ©
[a] => ª
[?] => «
[?] => ¬
[-] => ­
[?] => ®
[ˉ] => ¯
[°] => °
[±] => ±
[2] => ²
[3] => ³
[′] => ´
[μ] => µ
[?] => ¶
[·] => ·
[?] => ¸
[1] => ¹
[o] => º
[?] => »
[?] => ¼
[?] => ½
[?] => ¾
[?] => ¿
[à] => À
[á] => Á
[?] => Â
[?] => Ã
[?] => Ä
[?] => Å
[?] => Æ
[?] => Ç
[è] => È
[é] => É
[ê] => Ê
[?] => Ë
[ì] => Ì
[í] => Í
[?] => Î
[?] => Ï
[D] => Ð
[?] => Ñ
[ò] => Ò
[ó] => Ó
[?] => Ô
[?] => Õ
[?] => Ö
[×] => ×
[?] => Ø
[ù] => Ù
[ú] => Ú
[?] => Û
[ü] => Ü
[Y] => Ý
[T] => Þ
[?] => ß
[à] => à
[á] => á
[a] => â
[?] => ã
[?] => ä
[?] => å
[?] => æ
[?] => ç
[è] => è
[é] => é
[ê] => ê
[?] => ë
[ì] => ì
[í] => í
[?] => î
[?] => ï
[e] => ð
[?] => ñ
[ò] => ò
[ó] => ó
[?] => ô
[?] => õ
[?] => ö
[÷] => ÷
[?] => ø
[ù] => ù
[ú] => ú
[?] => û
[ü] => ü
[y] => ý
[t] => þ
[?] => ÿ
[?] => Œ
[?] => œ
[?] => Š
[?] => š
[?] => Ÿ
[?] => ƒ
[?] => ˆ
[?] => ˜
[Α] => Α
[Β] => Β
[Γ] => Γ
[Δ] => Δ
[Ε] => Ε
[Ζ] => Ζ
[Η] => Η
[Θ] => Θ
[Ι] => Ι
[Κ] => Κ
[Λ] => Λ
[Μ] => Μ
[Ν] => Ν
[Ξ] => Ξ
[Ο] => Ο
[Π] => Π
[Ρ] => Ρ
[Σ] => Σ
[Τ] => Τ
[Υ] => Υ
[Φ] => Φ
[Χ] => Χ
[Ψ] => Ψ
[Ω] => Ω
[α] => α
[β] => β
[γ] => γ
[δ] => δ
[ε] => ε
[ζ] => ζ
[η] => η
[θ] => θ
[ι] => ι
[κ] => κ
[λ] => λ
[μ] => μ
[ν] => ν
[ξ] => ξ
[ο] => ο
[π] => π
[ρ] => ρ
[ς] => ς
[σ] => σ
[τ] => τ
[υ] => υ
[φ] => φ
[χ] => χ
[ψ] => ψ
[ω] => ω
[ϑ] => ϑ
[ϒ] => ϒ
[ϖ] => ϖ
[ ] =>  
[ ] =>  
[ ] =>  
[] => ‌
[] => ‍
[] => ‎
[] => ‏
[–] => –
[—] => —
['] => ‘
['] => ’
[?] => ‚
["] => “
["] => ”
[?] => „
[?] => †
[?] => ‡
[?] => •
[…] => …
[‰] => ‰
[′] => ′
[″] => ″
[?] => ‹
[?] => ›
[‾] => ‾
[⁄] => ⁄
[€] => €
[ℑ] => ℑ
[℘] => ℘
[ℜ] => ℜ
[?] => ™
[ℵ] => ℵ
[←] => ←
[↑] => ↑
[→] => →
[↓] => ↓
[↔] => ↔
[↵] => ↵
[⇐] => ⇐
[⇑] => ⇑
[⇒] => ⇒
[⇓] => ⇓
[⇔] => ⇔
[∀] => ∀
[∂] => ∂
[∃] => ∃
[∅] => ∅
[∇] => ∇
[∈] => ∈
[∉] => ∉
[∋] => ∋
[∏] => ∏
[∑] => ∑
[−] => −
[∗] => ∗
[√] => √
[∝] => ∝
[∞] => ∞
[∠] => ∠
[∧] => ∧
[∨] => ∨
[∩] => ∩
[∪] => ∪
[∫] => ∫
[∴] => ∴
[∼] => ∼
[≅] => ≅
[≈] => ≈
[≠] => ≠
[≡] => ≡
[≤] => ≤
[≥] => ≥
[⊂] => ⊂
[⊃] => ⊃
[⊄] => ⊄
[⊆] => ⊆
[⊇] => ⊇
[⊕] => ⊕
[⊗] => ⊗
[⊥] => ⊥
[⋅] => ⋅
[⌈] => ⌈
[⌉] => ⌉
[⌊] => ⌊
[⌋] => ⌋
[〈] => ⟨
[〉] => ⟩
[◊] => ◊
[♠] => ♠
[♣] => ♣
[♥] => ♥
[♦] => ♦
)

相關(guān)文章
- PHP 教程
- PHP 安裝
- PHP 語法
- PHP 數(shù)組排序
- PHP 函數(shù)
- PHP 文件上傳
- PHP array_combine() 函數(shù)
- PHP array_pop() 函數(shù)
- PHP array_replace() 函數(shù)
- PHP array_reverse() 函數(shù)
- PHP array_uintersect() 函數(shù)
- PHP array_uintersect_uassoc() 函數(shù)
- PHP array_values() 函數(shù)
- PHP array_walk() 函數(shù)
- PHP ksort() 函數(shù)
- PHP shuffle() 函數(shù)
- PHP sizeof() 函數(shù)
- PHP uksort() 函數(shù)
- PHP 5 Calendar 函數(shù)
- PHP 5 Math 函數(shù)