note 55157 added to function.ord

From: Date: Tue, 26 Jul 2005 18:41:49 +0000
Subject: note 55157 added to function.ord
Groups: php.notes 
Request: Send a blank email to php-notes+get-92503@lists.php.net to get a copy of this message
To replace any characters in a string that could be 'dangerous' to put in an HTML/XML file with their numeric entities (e.g. &#233 for é [e acute]), you can use the following function: function htmlnumericentities($str){ return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str); };//EoFn htmlnumericentities ---- Manual Page -- http://www.php.net/manual/en/function.ord.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55157 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55157&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55157&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92503) next »