note 65376 added to function.htmlentities

From: Date: Sat, 29 Apr 2006 18:53:24 +0000
Subject: note 65376 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-110119@lists.php.net to get a copy of this message
Here's another version of that "allhtmlentities" function that an anonymous user posted in the last comment, only this one would be significantly more efficient. Again, this would convert anything that has an ASCII value higher than 127. <?php function allhtmlentities($string) { return preg_replace('/[^\x00-\x7F]/e', '"&#".ord("$0").";"', $string); } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 70.226.186.165 ---- 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/65376 Del: integrated -- http://master.php.net/note/delete/65376/integrated Del: useless -- http://master.php.net/note/delete/65376/useless Del: bad code -- http://master.php.net/note/delete/65376/bad+code Del: spam -- http://master.php.net/note/delete/65376/spam Del: non-english -- http://master.php.net/note/delete/65376/non-english Del: in docs -- http://master.php.net/note/delete/65376/in+docs Del: other reasons-- http://master.php.net/note/delete/65376 Reject -- http://master.php.net/note/reject/65376 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#110119) next »