note 27970 modified in function.html-entity-decode by derick
| From: | derick@php.net | Date: | Tue, 23 Sep 2003 11:32:57 +0000 |
| Subject: | note 27970 modified in function.html-entity-decode by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56963@lists.php.net to get a copy of this message | ||
If you're using a PHP version before 4.3.0:
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;
}
--was--
If you're not using the CVS version:
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;
}
http://www.php.net/manual/en/function.html-entity-decode.php