[PHP] get_html_translation_table()

get_html_translation_table() (funzione PHP) restituisce la tabella di conversione utilizzata dalle funzioni htmlentities() e htmlspecialchars().

tips&tricks

Sintassi

get_html_translation_table($table[facoltativo], $flags[facoltativo], $encoding[facoltativo])
parametro descrizione
$table Quale tabella da restituire: HTML_ENTITIES o HTML_SPECIALCHARS (default)
$flags ENT_COMPAT Table will contain entities for double-quotes, but not for single-quotes.
ENT_QUOTES Table will contain entities for both double and single quotes.
ENT_NOQUOTES Table will neither contain entities for single quotes nor for double quotes.
ENT_HTML401 Table for HTML 4.01.
ENT_XML1 Table for XML 1.
ENT_XHTML Table for XHTML.
ENT_HTML5 Table for HTML 5.
L’impostazione predefinita (default) è ENT_COMPAT | ENT_HTML401.
$encoding L’impostazione predefinita (default) è UTF-8

Esempi

print_r (get_html_translation_table());
/* RISULTATO
Array
(
    ["] => "
    [&] => &
    [<] => &lt;
    [>] => &gt;
)
*/

Contenuti correlati

  • CSS
  • HTML
  • JavaScript
  • jQuery
  • PHP
  • SQL
  • WORDPRESS

Fonti esterne

funzioni php, php

Related Articles

0 Comment