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

不言
Release: 2023-03-24 15:06:01
Original
1948 people have browsed it

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';
Copy after login

2. Download through composer

composer require oscarhan/ip-get
Copy after login

Or download the package on Github

git clone https://github.com/ouhaohan8023/IpGet.git
Copy after login

3. Use it in the program

The following describes how to use it in Thinkphp

<br/>
Copy after login
use Oscar\IpGet\IpGet;
$ip = &#39;100.100.0.1&#39;;
$model = new IpGet();
$location = $model->getlocation($ip);
var_dump($location);//XXXXX内蒙云基地
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template