Home >Backend Development >PHP Tutorial >PHP uses qqwry.bat to obtain the actual address used

PHP uses qqwry.bat to obtain the actual address used

不言
不言Original
2018-04-21 09:43:361950browse

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 = &#39;100.100.0.1&#39;;
$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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn