Display the drop-down list

html_entity_decode()

« highlight_string | htmlentities »
<?php
$string 
html_entity_decode (
    
// string $string
    
?// [int $flags = ENT_COMPAT | ENT_HTML401]
    
?  // [string $encoding = 'UTF-8']
);

// enter non ASCII characters in hex in $string if $encoding is not UTF-8
// the returned $string may not display properly if $encoding is not UTF-8

// shows the returned $string in UTF-8 if $encoding is not UTF-8
// note that $encoding below actually represents an argument
if ($encoding and $encoding != "UTF-8")
    
$utf8 mb_convert_encoding($string"UTF-8"$encoding);
?>
Result
$string = 'l"" is not "a"'
$utf8 = 'l"à" is not "a"'
Examples
#1 html_entity_decode  ("I'll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now")
#2 html_entity_decode  ("l&quot;\xe0&quot; is not &quot;a&quot;",
 
ENT_COMPAT,
 
"ISO-8859-1")
See also
get_html_translation_table, htmlentities, htmlspecialchars, urldecode