Chaîne de caractères
AddCSlashes AddSlashes bin2hex chop chr chunk_split convert_cyr_string count_chars crc32 crypt echo explode get_html_translation_table get_meta_tags hebrev hebrevc htmlentities htmlspecialchars implode join levenshtein localeconv ltrim md5 metaphone nl2br ord parse_str print printf quoted_printable_decode QuoteMeta rtrim sscanf setlocale similar_text soundex sprintf strncasecmp strcasecmp strchr strcmp strcoll strcspn strip_tags StripCSlashes StripSlashes stristr strlen strnatcmp strnatcasecmp strncmp str_pad strpos strrchr str_repeat strrev strrpos strspn strstr strtok strtolower strtoupper str_replace strtr substr substr_count substr_replace trim ucfirst ucwords wordwrap
Description
string get_html_translation_table(int table ,[int quote_style ])
get_html_translation_table retourne la table de traduction utilisée en interne par htmlspecialchars et htmlentities. Il y a deux nouvelles définitions : (html_entities, html_specialchars) qui vous permettent de spécifier vos propres tables.
<?php$trans = get_html_translation_table(HTML_ENTITIES);$str = "Hallo & <Frau> & Krämer";$encoded = strtr($str, $trans);?>
array_flip est alors très efficace pour inverser la direction de traduction :
<?php$trans = array_flip($trans);$original = strtr($str, $trans);?>
get_html_translation_table a été ajoutée en PHP 4.0.
Voir aussi htmlspecialchars, htmlentities, strtr et array_flip.