首页 手机号码归属地 手机号码归属地示例代码 手机归属地查询[PHP]

手机归属地查询示例代码[PHP]

作者: 阅读数:2531 上传时间:2016-03-10

手机归属地查询

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$shouji = '13456755448';
$url = "https://api.jisuapi.com/shouji/query?appkey=$appkey&shouji=$shouji";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['province'].' '.$result['city'].' '.$result['company'].' '.$result['cardtype'].'
';