• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

PHP通过API获取手机号码归属地_php实例

php 搞代码 4年前 (2022-01-25) 16次浏览 已收录 0个评论

该API接口自 2011年 SAE平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制 并发10

详细使用说明

接口地址:http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api

请求方法:GET

请求参数:

参数名 类型 必填 参数位置 描述 默认值
app string 是 urlParam 模块名称(不变) mobile
controller string 是 urlParam 控制器名称 index
action string 是 urlParam 操作名称 api
mobile string 是 urlParam 手机号码或号段 13800138000
outfmt string 是 urlParam 期望得到的结果类型 json
请求示例:

http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile=13800138000

JSON返回示例:

{  "id":"80012", <mark style="color:transparent">本%文来源gaodaimacom搞#^代%!码网@</mark>搞代gaodaima码  "Mobile":"13800138000",   "Province":"\u5317\u4eac",   "City":"\u5317\u4eac",   "AreaCode":"010",   "PostCode":"100000",   "Operators":"\u4e2d\u56fd\u79fb\u52a8",   "Card":"GSM"}

XML返回示例:

  13800138000   True  北京  北京  010  100000  中国移动  GSM

使用方法

function getMobileInfo($mobile)  {   $response = file_get_contents('http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile='.$mobile)    $result = json_decode($response,true);    return $result;}

以上所述就是本文的全部内容了,希望大家能够喜欢。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:PHP通过API获取手机号码归属地_php实例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址