Skip to content

一款 IP 地址解析 SDK,支持 5 家主流平台。

Notifications You must be signed in to change notification settings

yuanzhihai/easyip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyip

IP SDK.

StyleCI build status

安装

$ composer require yzh52521/easyip -vvv

介绍

目前支持 5 家平台

使用

$config = [
    'provider' => 'tencent',
    'tencent' => [
        'key' => '',
    ],
    
    ...
    ...
    ...
];

$ip = new \yzh52521\easyIp\EasyIp($config);

$result = $ip->parse('');

进入 config/easyip.php

return [
    'provider' => 'tencent',


    'tencent' => [
        'key' => '',
    ],
    
    ...
    ...
    ...
]

在think6中使用

app('EasyIp')->parse('')


...
...

数据返回格式

# 如果想要 api 原生格式,在 config/easyip.php 中,把 format 改为 false

[
     "provider" => "Tencent",
     "ip" => "",
     "postcode" => 440300,
     "country" => "中国",
     "province" => "广东省",
     "city" => "深圳市",
     "district" => "南山区",
     "implode" => "中国广东省深圳市南山区",
     "location" => [
       "latitude" => 22.55329,
       "longitude" => 113.88308,
     ],
]

License

MIT

About

一款 IP 地址解析 SDK,支持 5 家主流平台。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages