Posted by Mladen Gogala on 03/25/06 22:40
On Sat, 25 Mar 2006 20:04:55 +0000, Fernando Rodríguez wrote: > Hi, > > How can I tell if all characters in a string are US ASCII? > > Thanks $not_ascii=0; for ($i=0; $i<strlen($string); $i++) { $char=substr($string,$i,1); if ( (($char & 128) != 0) { $not_ascii=1; } } -- http://www.mgogala.com
[Reply to this message]
Copyright © 2005-2006 Powered by Custom PHP Programming