note 10606 added to strtr
| From: | bvr at xs4all dot nl | Date: | Fri, 12 Jan 2001 11:38:41 +0000 |
| Subject: | note 10606 added to strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9704@lists.php.net to get a copy of this message | ||
for translating html entities to text use this:
$trans = array_flip(get_html_translation_table(HTML_ENTITIES));
$trans["&"] = "&";
$str = strtr($str,$trans);
note that when you reverse the translation table with array_flip()
some characters aren't translated correctly (like & for example).
to check the translation table use:
print_r($trans);
bvr.
http://www.php.net/manual/function.strtr.php