note 47052 deleted from function.htmlentities by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:04:12 +0000 |
| Subject: | note 47052 deleted from function.htmlentities by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154933@lists.php.net to get a copy of this message | ||
Note Submitter: duke at redump dot de
----
The function xmlentities works great, but there can be up to 5 numbers after the &# string. See
this for example:
ベースボー
ルスターズ2
This is a valid (wrapped) japanese string. To successfully use it with xmlentities, you need to
replace
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&"
, strtr($string, $trans));
with
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/","&"
, strtr($string, $trans));
(3 to 5).
Duke