note 65200 added to function.htmlentities

From: Date: Wed, 26 Apr 2006 19:38:49 +0000
Subject: note 65200 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-109782@lists.php.net to get a copy of this message
This function will encode anything that is non Standard ASCII (that is, that is above #127 in the ascii table) // allhtmlentities : mainly based on "chars_encode()" by Tim Burgan <timburgan@gmail.com> [http://www.php.net/htmlentities] function allhtmlentities($string) { if ( strlen($string) == 0 ) return $string; $result = ''; $string = htmlentities($string, HTML_ENTITIES); $string = preg_split("//", $string, -1, PREG_SPLIT_NO_EMPTY); $ord = 0; for ( $i = 0; $i < count($string); $i++ ) { $ord = ord($string[$i]); if ( $ord > 127 ) { $string[$i] = '&#' . $ord . ';'; } } return implode('',$string); } ---- Server IP: 64.71.164.2 Probable Submitter: 200.55.109.252 ---- 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/65200 Del: integrated -- http://master.php.net/note/delete/65200/integrated Del: useless -- http://master.php.net/note/delete/65200/useless Del: bad code -- http://master.php.net/note/delete/65200/bad+code Del: spam -- http://master.php.net/note/delete/65200/spam Del: non-english -- http://master.php.net/note/delete/65200/non-english Del: in docs -- http://master.php.net/note/delete/65200/in+docs Del: other reasons-- http://master.php.net/note/delete/65200 Reject -- http://master.php.net/note/reject/65200 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#109782) next »