sypex/geo
最新稳定版本:0.3.2
Composer 安装命令:
composer require sypex/geo
包简介
Sypex deo actualized
README 文档
README
Actualized library from https://sypexgeo.net/ru/.
- composer
- PSR-2
- PSR-4
throwinstead ofdie- tests
Installation
composer require sypex/geo
Download Database file
wget https://sypexgeo.net/files/SxGeoCountry.zip unzip SxGeoCountry.zip rm SxGeoCountry.zip wget https://sypexgeo.net/files/SxGeoCity_utf8.zip unzip SxGeoCity_utf8.zip rm SxGeoCity_utf8.zip
Usage
$filepath = 'SxGeo.dat'; $geo = new Geo($filepath); // by default SxGeo.dat $geo = new SxGeo($filepath, Mode::BATCH | Mode::MEMORY); // the fastest way // Get country (SxGeo Country) // // 2-letter ISO code of country $country = $geo->getCountry($ip); // number of country $geo->getCountryId($ip); // get city (SxGeo City, SxGeo City Max) // // short information, without region name, country and timezone $geo->getCity($ip); // full city information $geo->getCityFull($ip); // calls getCountry or getCity depending on the type of base $city = $geo->get($ip); // free resource unset($geo);
统计信息
- 总下载量: 3.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2022-01-17