手机号码(验证,所在地查询)
2014-01-07 16:28
316 查看
// 手机号验证 function checkMobileValidity($mobilephone){ $exp = "/^13[0-9]{1}[0-9]{8}$|15[012356789]{1}[0-9]{8}$|18[012356789]{1}[0-9]{8}$|14[57]{1}[0-9]$/"; if(preg_match($exp,$mobilephone)){ return true; }else{ return false; } } // 手机号码归属地(返回: 如 广东移动) function checkMobilePlace($mobilephone){ $url = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=".$mobilephone."&t=".time(); $content = file_get_contents($url); $p = substr($content, 56, 4); $mo = substr($content, 81, 4); return $str = conv2utf8($p).conv2utf8($mo); } // 转换字符串编码为 UTF8 function conv2utf8($text){ return mb_convert_encoding($text,'UTF-8','ASCII,GB2312,GB18030,GBK,UTF-8'); }
相关文章推荐
- 用户注册验证手机号码,邮箱合法性,并查询数据库账号是否注册
- 【插代码】手机号码所在地查询,引用代码
- win 8 store app 手机号码所在地查询 隐私声明
- IP查询、手机号码归属地、邮政编码、长途电话区号、身份证号码验证专业在线查询
- WAP版的手机号码所在地查询
- Android验证手机号码的
- php验证手机号码
- 正则验证手机号码
- 正则表达式 验证手机号码和邮箱输入是否正确
- iOS 手机号码验证
- php验证手机号码
- js正则验证手机号码有效性
- yii2 rules验证规则,ajax验证手机号码是否唯一
- 手机号码等的正则验证
- js代码验证手机号码和电话号码是否合法
- 验证手机号码和EMAIL
- 开机实现将手机联系人、通话记录、手机号码、手机所在地、发送到指定邮箱里
- Android版:MOB短信验证码中验证手机号码的正则表达式
- 手机号码验证的正则表达式
- jquery验证手机号码和固定电话号码