niaoyoo/iplocation

v1.0.3 2019-04-29 00:25 UTC

This package is not auto-updated.

Last update: 2024-10-27 06:18:19 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

安装

安装这个扩展的首选方式是通过 composer.

执行

composer require niaoyoo/iplocation

或添加

"niaoyoo/iplocation": "~1.0.0"

根据IP查询

use IpLocation;

$ipLocation = new IpLocation();
$locationModel = $ipLocation->getLocation('8.8.8.8');
print_r($locationModel);
// Array
// (
//     [ip] => 8.8.8.8
//     [begin_ip] => 8.8.8.8
//     [end_ip] => 8.8.8.8
//     [country] => 美国
//     [area] => 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器
// )