In this problem, your job to write a function to check whether a input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging…
<?php /** * 纯真IP根据IP地址获得地址 */ class ipLocation { public $fp; public $firstip; //第一条ip索引的偏移地址 public $lastip; //最后一条ip索引的偏移地址 public $totalip; //总ip数 // //* //构造函数,初始化一些变量 //$datfile 的值为纯真IP数据库的名子,可自行修改. //* function __construct($datfile = "CoralWr…