标签: php正则
php 正则判断是否是手机号码 最新 分类:

 

 

[php] view plain copy
 
 print?
  1. $phonenumber = '13712345678';  
  2. if(preg_match("/^1[34578]{1}\d{9}$/",$phonenumber)){  
  3.     echo "是手机号码";  
  4. }else{  
  5.     echo "不是手机号码";  
  6. }  


"^"匹配文本的开头,"$"匹配文本的结尾。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案