note 47052 added to function.htmlentities

From: Date: Mon, 01 Nov 2004 14:44:23 +0000
Subject: note 47052 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-79450@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47052 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47052&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47052&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79450) next »