note 48852 deleted from function.htmlentities by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:03:49 +0000 |
| Subject: | note 48852 deleted from function.htmlentities by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154931@lists.php.net to get a copy of this message | ||
Note Submitter: Duane
----
I found using:
preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/",
"&",strtr($string, $trans));
didn't trap hex values (such as 的), so instead I ended
up using:
preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[x0-9a-f]{2,6};)/",
"&", strtr($string, $trans));