Home  >  Article  >  php教程  >  最完整的php验证手机号码

最完整的php验证手机号码

WBOY
WBOYOriginal
2016-06-07 11:38:461811browse

感觉网上的手机号码验证都不是很严格,自已写了一个,目前支持:

移动:134、135、136、137、138、139、150、151、152、157、158、159、182、183、184、187、188、178(4G)、147(上网卡);

联通:130、131、132、155、156、185、186、176(4G)、145(上网卡);

电信:133、153、180、181、189 、177(4G);

卫星通信:1349

虚拟运营商:170
/**<br> * 验证手机号是否正确<br> * @author 范鸿飞<br> * @param INT $mobile<br> */<br> function isMobile($mobile) {<br>     if (!is_numeric($mobile)) {<br>         return false;<br>     }<br>     return preg_match('#^13[\d]{9}$|^14[5,7]{1}\d{8}$|^15[^4]{1}\d{8}$|^17[0,6,7,8]{1}\d{8}$|^18[\d]{9}$#', $mobile) ? true : false;<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn