dgyun / ip_helper
Obtain the ip address and ip database
dev-master
2023-10-25 02:28 UTC
Requires
- php: >=7.0
This package is not auto-updated.
Last update: 2024-11-06 13:01:40 UTC
README
本库IP地址是基于 ip2region 简单整合,方便 PHP
项目使用 Composer
来安装。
通过 Composer 安装
composer require dgyun/ip_helper
在项目中快速调用
use Dgyun\IpHelper\Ip;
$result = (new Ip())->location('0.0.0.0');
var_dump($result);
获取客户端ip
use Dgyun\IpHelper\Ip;
$result = (new Ip())->get_client_ip();
$result = (new Ip())->get_client_ip_ali_cdn();
$result = (new Ip())->get_client_ip_tencent_cdn();
var_dump($result);