soltivo / location
一个简单的库,用于检测 IP 地址的位置。
1.0.0
2020-05-29 20:01 UTC
Requires
- guzzlehttp/guzzle: ~6.0
- php-parallel-lint/php-console-color: ^0.3.0
This package is auto-updated.
Last update: 2024-09-18 19:33:54 UTC
README
使用这个简单的库,您可以获取国家、州、城市以及关于您的用户的其他许多信息。
此库使用 ip-api.com 来检索 IP 地址的位置数据。
安装
composer require soltivo/location
用法
$options = [ "ip" => "127.0.0.1", "lang" => "en", "fields" => [ "isp", "org", "as", ] ]; $location = new \Soltivo\Location\Location($options); $countryaa2 = $location->countryCode; $state = $location->stateName; $city = $location->city;
选项
$options = [ "ip" => "", "fields" => [], "lang" => "", "test" => false ];
工作组件可以被附加到其他资源。
默认值
$testing = false; $lang = "en"; $fields = [ "country", "countryCode", "region", "regionName", "city", "zip", "proxy", "currency", "timezone", "continent", "continentCode", "district" ];
贡献
欢迎拉取请求。对于重大更改,请先打开一个问题以讨论您想要更改的内容。
许可
欢迎拉取请求。对于重大更改,请先打开一个问题以讨论您想要更改的内容。