首页 > 编程语言 >php 查询手机号归属接口

php 查询手机号归属接口

时间:2022-12-29 11:58:37浏览次数:46  
标签:city 手机号 resp 接口 php isd

<?php  
//手机号查询归属地
    function mobileAscription($mobile){
        $url = "https://chong.qq.com/tws/mobileqqprequery/GetMobileProductInfo?loginstate=1&vb2ctag=4_2038_1_1425_73&groupid=2038&productype=3&mobile={$mobile}&amount=3000%235000%2310000%2320000%2330000%2350000";
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        $data = curl_exec($curl);
        curl_close($curl);
        $data = mb_convert_encoding($data,'UTF-8','UTF-8,GBK,GB2312,BIG5');
        $resp = json_decode($data,true);
        $data = ['province'=>$resp['province'],'city'=>$resp['city'],'isd'=>$resp['isd']];
        return $data;
    }

var_dump($this->mobileAscription($mobile));

  

标签:city,手机号,resp,接口,php,isd
From: https://www.cnblogs.com/kevin-yang123/p/17012102.html

相关文章

  • PhpStorm 2022 for mac(PHP集成开发工具)v2022.3.1中文版
    mac版PhpStorm2022 v2022.3.1中文版更新了,PhpStorm2022formac(PHP集成开发工具)v2022.3.1中文版分享给大家,PhpStorm是一个实际“获取”你的代码的PHPIDE。它支持PHP......
  • C# 高级语法混合简单示例(接口、索引器)
    程序集如下  usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Text;usingSyst......
  • APP接口安全设计要点-软件测试知识
    请求合法性校验:请求合法性校验主要就是指如何避免API被非法的调用,比如系统里面有一个短信接口,就要考虑如何避免这个短信接口不被短信轰炸机滥用,可以采用的方式有......
  • PHP性能优化
    1.避免在循环时做一些运算操作以及数据库查询操作//优化前,每循环1次,都要执行1次count()函数$arr=[2,3,4,52,233,55,677];for($i=0;$i<count($arr);$i++){ //dos......
  • 编译php7.4和php8.0编译安装,pkg-config详情
    2022年12月21日15:49:28官网连接:https://www.php.net/manual/zh/migration74.other-changes.php#migration74.other-changes.pkg-config一些扩展已经迁移到只使用pkg-co......
  • How to install VirtualBox 6.x with phpVirtualbox web interface on Debian 11 bull
    HowtoinstallVirtualBox6.xwithphpVirtualboxwebinterfaceonDebian11bullseye/openmediavault6ThenewOpenMediaVault6usesDebian11asthebasesys......
  • 泛型接口 泛型仓储
    泛型接口:  泛型仓储  继承泛型接口   实体仓储继承泛型仓储就可以调用基类的CRUD  ......
  • LNMP架构环境之PHP环境部署
    1)使用第三方扩展源安装php7.1#1)配置PHP安装源yum -yinstallepel-releasewget​​https://mirror.webtatic.com/yum/el7/webtatic-release.rpm​​--no-check-cert......
  • 接口和抽象类
    接口接口中可以包含变量,方法。接口无法被实例化,接口没有构造方法。接口中的变量会被隐式指定为publicstaticfinal接口中的方法会被隐式指定为publicabstractidea也......
  • 华为路由器子接口
    网络描述:客户采用一台华为路由器作为网络出口,终端网关在路由器上,规划有三个vlan,10-20-30。解决办法:一种是路由器三个网口连接交换机;还有一种是路由器配置子接口,一根线连接交......