无为清净楼资源网 Design By www.qnjia.com
道理很简单,知道手机号规则 进行正则判断就可以
移动:134、135、136、137、138、139、150、151、157(TD)、158、159、187、188
联通:130、131、132、152、155、156、185、186
电信:133、153、180、189、(1349卫通)
HTML页面
<!DOCTYPE html> <html lang="en"> <head> <title>手机号归属</title> </head> <body> <input type="text" onblur="mobile_check($(this).val())" > </body> </html> <script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.min.js">controller控制代码
/* *@param string $phone 手机号字符串 *@return 0中国移动,1中国联通 2中国电信 3未知 */ public function phone_check(){ if(IS_POST){ $phone = I('phone'); $isChinaMobile = "/^134[0-8]\d{7}$|^("; //移动方面最新答复 $isChinaUnion = "/^("; //向联通微博确认并未回复 $isChinaTelcom = "/^("; //1349号段 电信方面没给出答复,视作不存在 // $isOtherTelphone = "/^170([059])\\d{7}$/";//其他运营商 if(preg_match($isChinaMobile, $phone)){ $this->ajaxReturn('中国移动'); //0 }else if(preg_match($isChinaUnion, $phone)){ $this->ajaxReturn('中国联通'); //1 }else if(preg_match($isChinaTelcom, $phone)){ $this->ajaxReturn('中国电信'); //2 }else{ $this->ajaxReturn('未知'); //3 } } $this->display(); }以上就是全部的实现代码了,需要的朋友可以参考一下
标签:
PHP,手机,运营商
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月25日
2024年09月25日
- 纯音入心系列纯音乐《天籁古筝》1CD[MP3][331MB]
- 男女对唱典藏天碟《发烧对唱·那个季节里的歌DSD》10CD[WAV]
- 群星2010-歌林精选辑[歌林][WAV+CUE]
- TrioZimbalist-PianoTriosofWeinberg,Auerbach,Dvorak(2024)[24-44,1]wav
- 群星.1992-滚石第一流台湾歌·12王牌大车拼【滚石】【WAV+CUE】
- 林子祥.1984-创作歌集【华纳】【WAV+CUE】
- 周汤豪.2010-周汤豪【华纳】【FLAC分轨】
- Mozart-TheStringQuintets-AmadeusQuartet,CecilAronowitz(2017)[24-44,1][WAV+CUE]
- JamesWilliamsDennisIrwin-Focus(2024,Red)[24-48]FLAC
- 藤泽麻衣《空みあげて》[WAV]
- 纯音入心系列纯音乐《中国古筝经典名曲》1CD[MP3][1.3GB]
- 纯音入心系列纯音乐《古筝新奏:岁月静好与筝语,细水流年与筝同》1CD[MP3][846.9MB]
- 670《脆弱敏感小女生》[320K/MP3][27.53MB]
- 曾琳.2011-好好爱我【南方】【WAV+CUE】
- 范晓萱.1995-RAIN【福茂】【WAV+CUE】