The content of this article is about PHP using qqwry.bat to obtain the actual address. It has a certain reference value. Now I share it with you. Friends in need can refer to it.
The steps are as follows:
1. Get the ip address, for example:
$ip = '100.100.100.1';
2. Download through composer
composer require oscarhan/ip-get
Or download the package on Github
git clone https://github.com/ouhaohan8023/IpGet.git
3. Use it in the program
The following describes how to use it in Thinkphp
<br/>
use Oscar\IpGet\IpGet; $ip = '100.100.0.1'; $model = new IpGet(); $location = $model->getlocation($ip); var_dump($location);//XXXXX内蒙云基地
Related recommendations:
PHP uses CURL to upload other people’s server images to your own image cloud space
The above is the detailed content of PHP uses qqwry.bat to obtain the actual address used. For more information, please follow other related articles on the PHP Chinese website!