<?php

$str = '若你安好便是晴天';
if (preg_match('/^[\x{4e00}-\x{9fa5}]+$/u', $str)>0) {
    echo '全是中文';
} else if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $str)>0) {
    echo '含有中文';
} else {
    echo '没有包含中文';
}

?>

 

相关文章:

  • 2021-10-31
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-02-08
  • 2022-12-23
猜你喜欢
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案