Display the drop-down list

htmlentities()

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

// enter non ASCII characters in hex in $string if $encoding is not UTF-8
?>
Result
$string = ''
Examples
#1 htmlentities  ("A 'quote' is <b>bold</b>")
#2 htmlentities  ("A 'quote' is <b>bold</b>",
 
ENT_QUOTES)
#3 htmlentities  ("\x8F!!!",
 
ENT_QUOTES,
 
"UTF-8")
#4 htmlentities  ("\x8F!!!",
 
ENT_QUOTES ENT_IGNORE,
 
"UTF-8")
#5 htmlentities  ("'à' is not 'a'",
 
ENT_QUOTES)
#6 htmlentities  ("'\xe0' is not 'a'",
 
ENT_QUOTES,
 
"ISO-8859-1")
See also
get_html_translation_table, html_entity_decode, htmlspecialchars, nl2br, urlencode