Decode HTML Special Entities (Rated 5)Description:
Convert all HTML entities to their applicable characters.
e.g. & amp; (minus the space) will be converted to & Code starts here
<?PHP
function decodeHTML($string) {
$string = strtr($string, array_flip(get_html_translation_table(HTML_ENTITIES)));
$string = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $string);
return $string;
}
?>
Last Edited: November 12, 2005, 12:17 pm
Submitted by Devscripts on 12-11-2005 12:17 |