如何通过PHP查询手机号码的详细归属地信息?
- 内容介绍
- 文章标签
- 相关推荐
本文共计216个文字,预计阅读时间需要1分钟。
PHP获取手机号码归属地,该API接口自2011年SAE平台上线稳定运行至今,增加了17项支持的采集注限制,并支持10%的详细使用说明。详见http://apistore.baidu.com/serviceinfo/27816.
php
// 解析返回的数据$result=json_decode($response, true);if (isset($result['returncode']) && $result['returncode']==0) { echo 手机号码:{$phone}\n; echo 归属地:{$result['data']['province']} - {$result['data']['city']}\n;} else { echo 获取信息失败:{$result['returnmsg']}\n;}?>
该API接口自2011年SAE平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制并发10
详细使用说明见apistore.baidu.com/astore/serviceinfo/27816.html
1.[代码][PHP]代码
function getMobileInfo($mobile) { $response = file_get_contents('appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile='.$mobile) $result = json_decode($response,true); return $result; }
本文共计216个文字,预计阅读时间需要1分钟。
PHP获取手机号码归属地,该API接口自2011年SAE平台上线稳定运行至今,增加了17项支持的采集注限制,并支持10%的详细使用说明。详见http://apistore.baidu.com/serviceinfo/27816.
php
// 解析返回的数据$result=json_decode($response, true);if (isset($result['returncode']) && $result['returncode']==0) { echo 手机号码:{$phone}\n; echo 归属地:{$result['data']['province']} - {$result['data']['city']}\n;} else { echo 获取信息失败:{$result['returnmsg']}\n;}?>
该API接口自2011年SAE平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制并发10
详细使用说明见apistore.baidu.com/astore/serviceinfo/27816.html
1.[代码][PHP]代码
function getMobileInfo($mobile) { $response = file_get_contents('appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile='.$mobile) $result = json_decode($response,true); return $result; }

