php 判断输入的中文或者英文

版权声明:本人原创文章,转载时请保留所有权并以超链接形式标明文章出处 https://blog.csdn.net/qq_37138818/article/details/84325796
function ischinese($s){
    if (preg_match('/^[\x{4e00}-\x{9fa5}]+$/u',$s)) {
        print("中文");
    } else {
        print("不全部是中文");
    }

}


 

猜你喜欢

转载自blog.csdn.net/qq_37138818/article/details/84325796