使用正则表达式,比如下面判断$username是否完全是中文:
preg_match("/^[\x{4e00}-\x{9fa5}]+$/u", $username);
Posted in php
04 Dec 2008
My name is Richard Huang, a Rubyist and open source advocate.