用js来判断吧,不需要用到php
\u4E00-\u9FA5这个中文字符正则匹配

解决方案 »

  1.   

    /*** 返回字节数 ***/
    String.prototype.lenb = function() {
    return this.replace(/[^\x00-\xff]/g,"**").length;
    }/*** 检查是否包含汉字 ***/
    String.prototype.isInChinese = function() {
    return (this.length != this.lenb());
    }php:
    preg_mtch_all("/[\x80-\xff]?./",$text,$r);
    if(count($r[0] != strlen($text))
    echo "有汉字"; [/B]