key值可以改成自己的,key值可以改成自己的,key值可以改成自己的,php电话归属地查询,聚合接口
function huoqutel($tel){
$curl = curl_init();
$url ='http://apis.juhe.cn/mobile/get?phone='.$tel.'&key=c2e4a5c772127a38b9533a83b2068815';
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
$data=curl_exec($curl);
curl_close($curl);
$data = json_decode($data,true);
return mb_convert_encoding($data['result']['province']." ".$data['result']['city'],"gbk","utf-8");
}