php获取手机号码归属地
用户leaps/httpclient
可直接用 file_get_contents代替
该api接口自 2011年 sae平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制 并发10
function getMobileInfo($mobile)
{
$http = new HttpClient ();
$response = $http->get ( 'http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile='.$mobile );
if ($response->getHttpCode () == '200') {
$result = json_decode($response->getBody(),true);
return $result;
}
return false;
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号