-<[ Rene Brehmer ]>- wrote:
127 is the last of the 7bit numbers (01111111), 128 has the 8th bit on (10000000), so perhaps you want to test for > 127 rather than > 128.something like this (untested):for ($i = 0; $i < strlen($string_to_parse); $i++) { $char = substr($string_to_parse, $i, 1); if (ord($char) > 128) { $output_string .= "&#".ord($char).";"; } else { $output_string .= $char; } } You may need to test for value 127 ... not sure if it starts on 0 or 1 that is...
Regards
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php