时间:2021-07-01 10:21:17 帮助过:18人阅读
$pattern = "/^([\x{4e00}-\x{9fa5}]{1,10}
------解决方案--------------------
[a-z]{1,30})$/iu";
$test = array("这是中文","中文and英文","thisisenglish");
foreach($test as $word){
echo $word;
echo " : ";
echo preg_match($pattern,$word);
echo "
";
}