RE: [PHP] Re: high-bit characters

From: Date: Sat, 09 Jun 2007 12:25:32 +0000
Subject: RE: [PHP] Re: high-bit characters
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-256433@lists.php.net to get a copy of this message
Thanks, I'll check this out. Till now I managed to get the result I wanted with : <?php for ($i=0 ; $i < strlen($post_text) ; $i++) { $chr = $post_text{$i}; $ord = ord($chr); if (($ord<32 or $ord>126) and ($ord != 13) and ($ord != 10)){ Echo "BAD CHAR is : " . $ord; break; } } ?> berber -----Original Message----- From: news [mailto:news@sea.gmane.org] On Behalf Of Abdullah Ramazanoglu Sent: Friday, June 08, 2007 11:43 PM To: php-general@lists.php.net Subject: [PHP] Re: high-bit characters WeberSites LTD dedi ki: > I'm trying to validate an RSS feed and getting errors about "high-bit > characters". > How can I check if a string contains any high-bit characters? if (preg_match("/[\x80-\xff]/", $string)) { # high-bit char found } else { # no high-bit char } -- Abdullah Ramazanoglu aramazan ÄT myrealbox D0T cöm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#256433) next »