note 65954 added to function.htmlentities
| From: | soapergem at gmail dot com | Date: | Wed, 10 May 2006 18:14:01 +0000 |
| Subject: | note 65954 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111081@lists.php.net to get a copy of this message | ||
A quick revision to my last comment. For some reason, leaving the control characters in the safe
range seemed to screw things up. So instead, using this function will do what everybody else here is
trying to do, but it will do so in a single line:
<?php
$text = preg_replace('/[^\x09\x0A\x0D\x20-\x7F]/e',
'"&#".ord($0).";"', $text);
?>
----
Server IP: 216.194.113.175
Probable Submitter: 70.226.174.193
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- http://master.php.net/note/edit/65954
Del: integrated -- http://master.php.net/note/delete/65954/integrated
Del: useless -- http://master.php.net/note/delete/65954/useless
Del: bad code -- http://master.php.net/note/delete/65954/bad+code
Del: spam -- http://master.php.net/note/delete/65954/spam
Del: non-english -- http://master.php.net/note/delete/65954/non-english
Del: in docs -- http://master.php.net/note/delete/65954/in+docs
Del: other reasons-- http://master.php.net/note/delete/65954
Reject -- http://master.php.net/note/reject/65954
Search -- http://master.php.net/manage/user-notes.php