note 35934 added to function.htmlentities

From: Date: Fri, 19 Sep 2003 15:14:59 +0000
Subject: note 35934 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-56774@lists.php.net to get a copy of this message
// htmlentities() does not support Mac Roman, so this is a workaround. It requires the below table. // This function runs on a Mac OSX machine, where text is stored in the Mac Roman character set inside a Mac OSX MySQL table. function custom_htmlentities ($string, $table) { // Loop throught the array, replacing each ocurrance for ($n = 0; $n < count($table); $n++) { $table_line = each($table); // use the chr function to get the one character string for each ascii decimal code $find_char = chr($table_line[key]); $replace_string = $table_line[value]; $string = str_replace($find_char, $replace_string, $string); } return $string; } ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35934 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35934&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35934&report=yes

« previous php.notes (#56774) next »