get_html_translation_table() function returns the translation table used by htmlspecialchars() and htmlentities().
[table caption=”List of available flags constants are” max-width=”100%” colwidth=”25%|75%” colalign=”left|left”]
Constant Name, Description
ENT_COMPAT, It will decodes double-quotes only.
ENT_QUOTES, It will decodes both double and single quotes.
ENT_NOQUOTES, It will not decodes both double and single quotes.
ENT_HTML401, Handle code as HTML 4.01.
ENT_XML1, Handle code as XML 1.
ENT_XHTML, Handle code as XHTML.
ENT_HTML5, Handle code as HTML 5.
[/table]
Note : Any other character sets are not recognized. The default encoding will be used instead and a warning will be emitted.
This will return a decoded string.
[table caption=”” width=”100%” colwidth=”25%|75%” colalign=”left|left”]
Version, Description
PHP 5.4.0 , The default value for the encoding parameter was changed to UTF-8.
PHP 5.4.0 ,The constants ENT_HTML401 / ENT_XML1 / ENT_XHTML / ENT_HTML5 were introduced.
PHP 5.3.4 , The encoding parameter was added.
[/table]
<?php print_r (get_html_translation_table()); // HTML_SPECIALCHARS is default. ?>
See below is the output of above code in web browser.
Array
(
[“] => "
[&] => &
[<] => <
[>] => >
)
<?php print_r (get_html_translation_table(HTML_ENTITIES)); ?>
See below is the output of above code in Web browser.
App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…
As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…
Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…
COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…
Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…
For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…