正则匹配中文

        $str = '';

        if (preg_match('/^[\x{4e00}-\x{9fa5}]+$/u',$str)){
            echo '中文';
        } else {
            echo 'no';
        }

 

posted @ 2019-09-04 11:25  盘思动  阅读(394)  评论(0编辑  收藏  举报