yii2-extension yii2-ip2location
Yii2 Ip to Location
myweishanli/yii2-ip2location
Yii2 Ip to Location
- Tuesday, May 17, 2016
- by myweishanli
- Repository
- 2 Watchers
- 15 Stars
- 259 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 4 Forks
- 0 Open issues
- 2 Versions
- 17 % Grown
Yii2 Ip to Location
安装
安装这个扩展的首选方式是通过 composer., (*1)
执行, (*2)
composer require --prefer-dist myweishanli/yii2-ip2location
或添加, (*3)
"myweishanli/yii2-ip2location": "~1.0.0"
根据IP查询
use \wsl\ip2location\Ip2Location;
$ipLocation = new Ip2Location();
$locationModel = $ipLocation->getLocation('8.8.8.8');
print_r($locationModel->toArray());
// Array
// (
// [ip] => 8.8.8.8
// [begin_ip] => 8.8.8.8
// [end_ip] => 8.8.8.8
// [country] => 美国
// [area] => 加利福尼亚州圣克拉拉县山景市谷歌公司DNS服务器
// )
升级数据库
use \wsl\ip2location\QQWry;
$qqwry = new QQWry();
$qqwry->upgrade();
dev-master
9999999-dev
Yii2 Ip to Location
Sources
Download
MIT
The Requires
by
Shanli Wei
1.0.0
1.0.0.0
Yii2 Ip to Location
Sources
Download
MIT
The Requires
by
Shanli Wei