October 2005
Intermediate to advanced
372 pages
11h 35m
English
html_entities()
string html_entities ( stringhtml[, intoptions[, stringcharset]] )
The html_entities() function converts characters that are illegal in HTML, such as &, <, and ", into their safe equivalents: &, <, and ", respectively.
$flowerpot_men = "Bill & Ben";
$safe_flowerpots = htmlentities($flowerpot_men);
// it's now "Bill & Ben"This method of encoding is often referred to as &-escaping. You can reverse this conversion using the html_entity_decode()
function.