Ejemplo
Imprimir la tabla de traducción utilizada por la función htmlspecialchars:
<?php
print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default.
?>
Ejecutar ejemplo » Definición y Uso
El get_html_translation_table() función devuelve la tabla de traducción utilizada por los htmlentities() y htmlspecialchars() funciones.
Tip: Algunos caracteres se puede codificar varias maneras. El get_html_translation_table() función devuelve la codificación más común.
Sintaxis
get_html_translation_table( function,flags,character-set )
Parámetro | Descripción |
---|---|
function | Opcional. Especifica qué tabla de traducción para regresar. Valores posibles:
|
flags | Opcional. Especifica que cita la tabla contendrá y qué documento escriba la tabla es para. Los estilos de cotización disponibles son:
banderas adicionales para especificar qué DOCTYPE la tabla es para:
|
character-set | Opcional. Una cadena que especifica el conjunto de caracteres a utilizar. Los valores permitidos son:
Note: no reconocidos conjuntos de caracteres serán ignoradas y reemplazadas por la norma ISO-8859-1 en las versiones anteriores a PHP 5.4. A partir de PHP 5.4, se ignorará una sustituye por UTF-8. |
Detalles técnicos
Valor de retorno: | Devuelve la tabla de traducción como una matriz, con los personajes originales como llaves y entidades como valores |
---|---|
Versión de PHP: | 4+ |
cambios: | El valor predeterminado para el parámetro juego de caracteres fue cambiado a UTF-8 en PHP 5 Las banderas adicionales para especificar qué DOCTYPE la tabla es para; ENT_HTML401, ENT_HTML5, ENT_XML1 y ENT_XHTML se añadieron en PHP 5.4 El parámetro juego de caracteres fue agregado en PHP 5.3.4 |
Más ejemplos
Ejemplo
Mesa para HTML_SPECIALCHARS:
<?php
print_r (get_html_translation_table(HTML_SPECIALCHARS));
?>
Viendo carácter y entidad nombre:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
)
Ejemplo 2
Mesa para HTML_ENTITIES:
<?php
print_r (get_html_translation_table(HTML_ENTITIES));
?>
Viendo carácter y entidad nombre:
Array
(
["] => "
[&] => &
[<] => <
[>] => >
[ ] =>
[] => ¡
[] => ¢
[] => £
[] =>
¤
[] => ¥
[] => ¦
[] => §
[] => ¨
[] => ©
[] => ª
[] => «
[] => ¬
[] =>
­
[] => ®
[] => ¯
[] => °
[] => ±
[] => ²
[] => ³
[] => ´
[] => µ
[] =>
¶
[] => ·
[] => ¸
[] => ¹
[] => º
[] => »
[] => ¼
[] => ½
[] => ¾
[] => ¿
[] => À
[] => Á
[] => Â
[] => Ã
[] => Ä
[] => Å
[] => Æ
[]
=> Ç
[] => È
[] => É
[] => Ê
[]
=> Ë
[] => Ì
[] => Í
[] => Î
[] =>
Ï
[] => Ð
[] => Ñ
[] => Ò
[] => Ó
[] => Ô
[] => Õ
[] => Ö
[] => ×
[]
=> Ø
[] => Ù
[] => Ú
[] => Û
[]
=> Ü
[] => Ý
[] => Þ
[] => ß
[] => à
[] => á
[] => â
[] => ã
[] => ä
[]
=> å
[] => æ
[] => ç
[] => è
[] =>
é
[] => ê
[] => ë
[] => ì
[] => í
[] => î
[] => ï
[] => ð
[] => ñ
[] =>
ò
[] => ó
[] => ô
[] => õ
[] => ö
[] => ÷
[] => ø
[] => ù
[] => ú
[] => û
[] => ü
[] => ý
[] => þ
[]
=> ÿ
[] => Œ
[] => œ
[] => Š
[] => š
[] => Ÿ
[] => ƒ
[] => ˆ
[] => ˜
[Α] =>
Α
[Β] => Β
[Γ] => Γ
[Δ] => Δ
[Ε] =>
Ε
[Ζ] => Ζ
[Η] => Η
[Θ] => Θ
[Ι] =>
Ι
[Κ] => Κ
[Λ] => Λ
[Μ] => Μ
[Ν] => Ν
[Ξ] => Ξ
[Ο] => Ο
[Π] => Π
[Ρ] => Ρ
[Σ] =>
Σ
[Τ] => Τ
[Υ] => Υ
[Φ] => Φ
[Χ] => Χ
[Ψ] => Ψ
[Ω] => Ω
[α] => α
[β] => β
[γ] =>
γ
[δ] => δ
[ε] => ε
[ζ] => ζ
[η] =>
η
[θ] => θ
[ι] => ι
[κ] => κ
[λ] =>
λ
[μ] => μ
[ν] => ν
[ξ] => ξ
[ο] => ο
[π] => π
[ρ] => ρ
[ς] => ς
[σ] => σ
[τ] =>
τ
[υ] => υ
[φ] => φ
[χ] => χ
[ψ] => ψ
[ω] => ω
[ϑ] => ϑ
[ϒ] => ϒ
[ϖ] => ϖ
[ ]
=>  
[ ] =>  
[ ] =>  
[] => ‌
[] => ‍
[] => ‎
[] => ‏
[] => –
[] => —
[] => ‘
[] => ’
[] => ‚
[] => “
[] => ”
[]
=> „
[] => †
[] => ‡
[] => •
[] =>
…
[] => ‰
[′] => ′
[″] => ″
[] => ‹
[] => ›
[‾] => ‾
[⁄] => ⁄
[] => €
[ℑ]
=> ℑ
[℘] => ℘
[ℜ] => ℜ
[] => ™
[ℵ] => ℵ
[←] => ←
[↑] => ↑
[→] => →
[↓] => ↓
[↔] => ↔
[↵] => ↵
[⇐] => ⇐
[⇑] => ⇑
[⇒] => ⇒
[⇓] =>
⇓
[⇔] => ⇔
[∀] => ∀
[∂] => ∂
[∃] =>
∃
[∅] => ∅
[∇] => ∇
[∈] => ∈
[∉] => ∉
[∋] => ∋
[∏] => ∏
[∑] => ∑
[−] => −
[∗] => ∗
[√] => √
[∝] => ∝
[∞] => ∞
[∠] => ∠
[∧] =>
∧
[∨] => ∨
[∩] => ∩
[∪] => ∪
[∫] => ∫
[∴]
=> ∴
[∼] => ∼
[≅] => ≅
[≈] => ≈
[≠] =>
≠
[≡] => ≡
[≤] => ≤
[≥] => ≥
[⊂] => ⊂
[⊃]
=> ⊃
[⊄] => ⊄
[⊆] => ⊆
[⊇] => ⊇
[⊕] => ⊕
[⊗] => ⊗
[⊥] => ⊥
[⋅] => ⋅
[⌈] => ⌈
[⌉]
=> ⌉
[⌊] => ⌊
[⌋] => ⌋
[〈] => ⟨
[〉] =>
⟩
[◊] => ◊
[♠] => ♠
[♣] => ♣
[♥] =>
♥
[♦] => ♦
)
<String Referencia PHP