note 55157 deleted from function.ord by betz

From: Date: Tue, 26 Jul 2005 18:58:51 +0000
Subject: note 55157 deleted from function.ord by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-92506@lists.php.net to get a copy of this message
Note Submitter: webmaster at swirldrop dot com ---- 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

« previous php.notes (#92506) next »