testingmic/ipaddress
最新稳定版本:v1.3
Composer 安装命令:
composer require testingmic/ipaddress
包简介
Get the current visitor IP Address and determine the country, city, latitude, longitude, and ISP
README 文档
README
An IP address helps you identify visitors geographical location.
A PHP IP Address Geolocation library to help you identify visitors geographical location.
Requirements
- pdo_sqlite (runtime deps)
- php_curl (for update only)
Installation And Initialisation :
These instructions will get you a copy of the project up and running on your local machine. there are two options:
- Using Composer installer(Recommended) by typing the following command:
composer require testingmic/ipaddress
Usage: (using Composer autoloader)
require __DIR__ . '/vendor/autoload.php'; try { $IpAddressGeo = new testingmic\IpAddress(); } catch (\Throwable $th) { trigger_error($th->getMessage(), E_USER_ERROR); }
Getting Country code from given IP address:
$ipAddress_1='37.140.250.97'; echo '<pre>'; print_r($IpAddressGeo->resolve($ipAddress_1)); Array ( [start] => 629996032 [end] => 629996288 [country_code] => UA [country_name] => United States [continent_code] => NA [city] => Alexandria [latitude] => 38.8031 [longitude] => -77.0388 )
Getting current visitor Country code (auto detect his IP address):
echo '<pre>'; print_r($IpAddressGeo->resolve()); /** resolve() method called without any argument */
统计信息
- 总下载量: 2.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-12-15