2 /* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
3 * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
4 * Source code: ext/standard/html.c
7 /* Test get_html_translation_table() when table is specified as HTML_ENTITIES */
9 //set locale to en_US.UTF-8
10 <<__EntryPoint
>> function main(): void
{
11 setlocale(LC_ALL
, "en_US.UTF-8");
13 echo "*** Testing get_html_translation_table() : basic functionality ***\n";
15 // Calling get_html_translation_table() with all arguments
16 // $table as HTML_ENTITIES and different quote style
17 echo "-- with table = HTML_ENTITIES & quote_style = ENT_COMPAT --\n";
18 $table = HTML_ENTITIES
;
19 $quote_style = ENT_COMPAT
;
20 $tt = get_html_translation_table($table, $quote_style, "UTF-8");
24 echo "-- with table = HTML_ENTITIES & quote_style = ENT_QUOTES --\n";
25 $quote_style = ENT_QUOTES
;
26 $tt = get_html_translation_table($table, $quote_style, "UTF-8");
30 echo "-- with table = HTML_ENTITIES & quote_style = ENT_NOQUOTES --\n";
31 $quote_style = ENT_NOQUOTES
;
32 $tt = get_html_translation_table($table, $quote_style, "UTF-8");