note 44387 added to function.htmlentities
| From: | attila at roughdot dot com | Date: | Wed, 04 Aug 2004 14:25:21 +0000 |
| Subject: | note 44387 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73928@lists.php.net to get a copy of this message | ||
Thx for that function, pinkpanther at swissonline dot ch, though the number of digits after the
'#' can be 4, not 3.
I bumped into this when struggeling with the euro sign (€).
function htmlentities2( $myHTML)
{
$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES);
$translation_table[chr( 38)] = '&';
return preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/",
"&" , strtr( $myHTML, $translation_table));
}
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44387
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44387&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44387&report=yes
Search -- http://master.php.net/manage/user-notes.php