//验证字符串$str="编程";//用正则匹配判断if(preg_match('/^[0-9a-zA-Z_\x{4e00}-\x{9fa5}]+$/u',$str)){ echo '符合验证规则!!';}else{ echo '不符合验证规则!!';}?>