note 28132 added to function.get-html-translation-table
| From: | kevin_bro at hostedstuff dot com | Date: | Fri, 03 Jan 2003 12:06:58 +0000 |
| Subject: | note 28132 added to function.get-html-translation-table | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41597@lists.php.net to get a copy of this message | ||
Alans version didn't seem to work right. If you're having the same problem consider using
this slightly modified version instead:
function unhtmlentities ($string) {
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
$ret = strtr ($string, $trans_tbl);
return preg_replace('/&#(\d+);/me',
"chr('\\1')",$ret);
}
--
http://www.php.net/manual/en/function.get-html-translation-table.php
http://master.php.net/manage/user-notes.php?action=edit+28132
http://master.php.net/manage/user-notes.php?action=delete+28132
http://master.php.net/manage/user-notes.php?action=reject+28132