<?php
 header('Content-type:text/html; charset=utf-8');
 $str = '你好';
 if(preg_match('/^[\x{4e00}-\x{9fa5}]+$/u', $str)>0){
  echo '全是中文';
 }elseif(preg_match('/[\x{4e00}-\x{9fa5}]/u', $str)>0){
  echo '含有中文';
 }
?>

 

相关文章:

  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-05-23
猜你喜欢
  • 2021-09-08
  • 2022-01-02
  • 2021-10-14
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案