$str="hello world 你好世界~"; 

$num = preg_match_all("/[a-zA-Z]/",$str,$words); 

echo $num; 

print_r($words); 
$num = preg_match_all("/[\xB0-\xF7][\xA1-\xFE]/",iconv('UTF-8','GBK',$str),$words); 

 

posted on 2013-12-17 09:25  FreeSpider  阅读(129)  评论(0编辑  收藏  举报