只需3步,PHP利用qqwry.bat获取实际使用地址

步骤如下:

1.获取ip地址,例如:

$ip = '100.100.100.1';  

2.通过composer下载

composer require oscarhan/ip-get  

或者再Github上下载包

git clone https://github.com/ouhaohan8023/IpGet.git  

3.在程序中使用

下面介绍在Thinkphp中如何使用

use Oscar\IpGet\IpGet;  

$ip = '100.100.0.1';  

$model = new IpGet();  

$location = $model->getlocation($ip);  

var_dump($location);//XXXXX内蒙云基地  

你可能感兴趣的:(只需3步,PHP利用qqwry.bat获取实际使用地址)