generateIP
Randomly generate the IPv4 address corresponding to the province based on the province name.
Directory files
QueryList.class.php // PHP采集类
phpQuery // QueryList类所需文件目录
IP.class.php // 主IP生成类
ip_segment.php // 采集生成的IPV4地址段
Instructions for use
Introduce IP class
require 'IP.class.php';
Method usage
If you do not specify a province name, a domestic IPV4 address will be randomly generated.
$ip_address = IP::generate();
Specify the province name to generate the corresponding province IPV4 address
$ip_address = IP::generate('安徽');
Update IPV4 address segments in each province
IP::update();
The file contains provinces:
* 北京 * 广东 * 山东 * 浙江 * 江苏 * 上海 * 辽宁 * 四川 * 河南 * 湖北 * 福建 * 湖南 * 河北 * 重庆 * 山西 * 江西 * 陕西 * 安徽 * 黑龙江 * 广西 * 吉林 * 云南 * 天津 * 内蒙 * 新疆 * 甘肃 * 贵州 * 海南 * 宁夏 * 青海 * 西藏
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
20 Jul 2016
PHP queries the region based on IP (Innocent IP library). Download innocent ip library? phpclass IpLocation { /** * @var resource pointer */ private $fp; /** * Offset address of the first IP record * @var int */ private $firstip; /** * Finally an IP record
21 Jul 2016
A brief analysis of the coral polyp IP library. This is nothing new, someone has done it a long time ago. It is to use PHP to operate the pure IP library or the coral IP library to get the physical location based on the visitor's IP. I
29 Jul 2016
php, use: PHP does not require an IP library, get the city name to use!: In a recent secondary development, the current city needs to be developed to enter automatic selection, so I thought of a way to use PHP without an IP library, get the city name to use! Get User city information can also use the Innocence IP library, but the city entry function I am currently developing is like Meituan. It seems that the IP library cannot be used directly, so we can only steal other people's IP library information... External IP I temporarily provide two Sina interface addresses for obtaining library information, which are relatively stable: http://int.dpool.sina.com.cn/
20 Jul 2016
Make an own binary IP library file. 1. Foreword Friends who have done the IP address query function should have heard of the Innocence IP library. The Innocence IP database query is similar to this: If you only need to search for the user’s home address based on IP and then
23 Jul 2016
Use Sina IP library to obtain IP detailed address
13 Jul 2016
Use Taobao IP library to obtain user IP geographical location. Taobao has announced their IP library http://ip.taobao.com/ and REST API interface, but the access frequency of each user must be less than 10qps, access method: http://ip.taobao.com/service/ getIpInfo.