webazon/ipinfo
最新稳定版本:1.0.0
Composer 安装命令:
composer require webazon/ipinfo
包简介
PHP library for IPinfo (IP geolocation and other types of IP data)
README 文档
README
We decided to create a project fork https://github.com/ipinfo/php/ to explore new features independently.
PHP Library for IPinfo (IP Geolocation and other IP Data Types)
Additionally, a feature has been integrated to set the language locale in accordance with the country determined by the user's IP address.
!!! To get your personal access token, visit https://ipinfo.io/
use Webazon\Ipinfo\Ipinfo; use Webazon\Ipinfo\Exception; require './vendor/autoload.php'; $ipinfo = new Ipinfo('access_token',[IP-адрес]); ## If the IP address parameter is not provided, it returns the visitor's IP data. $locale = $ipinfo -> locale;
Example of the returned $ipinfo object
$ipinfo=json_encode($ipinfo,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
{
"ip": "77.91.69.93",
"locale": "he_IL",
"exception": false,
"ipinfo": {
"country": "IL",
"country_name": "Israel",
"country_flag": {
"emoji": "🇮🇱",
"unicode": "U+1F1EE U+1F1F1"
},
"country_code": null,
"country_flag_url": "https:\/\/cdn.ipinfo.io\/static\/images\/countries-flags\/IL.svg",
"country_currency": {
"code": "ILS",
"symbol": "₪"
},
"continent": {
"code": "AS",
"name": "Asia"
},
"latitude": "32.0809",
"longitude": "34.7806",
"loc": "32.0809,34.7806",
"is_eu": false,
"ip": "77.91.69.93",
"hostname": "static.93.69.91.77.ip.webhost1.net",
"anycast": null,
"city": "Tel Aviv",
"org": "AS206446 CLOUD LEASE Ltd",
"postal": null,
"region": "Tel Aviv",
"timezone": "Asia\/Jerusalem",
"asn": null,
"company": null,
"privacy": null,
"abuse": null,
"domains": null,
"bogon": null,
"all": {
"ip": "77.91.69.93",
"hostname": "static.93.69.91.77.ip.webhost1.net",
"city": "Tel Aviv",
"region": "Tel Aviv",
"country": "IL",
"loc": "32.0809,34.7806",
"org": "AS206446 CLOUD LEASE Ltd",
"timezone": "Asia\/Jerusalem",
"country_name": "Israel",
"is_eu": false,
"country_flag": {
"emoji": "🇮🇱",
"unicode": "U+1F1EE U+1F1F1"
},
"country_flag_url": "https:\/\/cdn.ipinfo.io\/static\/images\/countries-flags\/IL.svg",
"country_currency": {
"code": "ILS",
"symbol": "₪"
},
"continent": {
"code": "AS",
"name": "Asia"
},
"latitude": "32.0809",
"longitude": "34.7806"
}
}
}
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-12