PHP code example of strongdonkey / iplocator
1. Go to this page and download the library: Download strongdonkey/iplocator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
strongdonkey / iplocator example snippets
use Strongdonkey\IPLocator\Locator;
var_dump(Locator::find('52.206.227.240'));
//返回值
array(4) {
["beginip"]=>
string(10) "52.200.0.0" //当前IP段起始
["endip"]=>
string(14) "52.207.255.255" //当前IP段结束
["country"]=>
string(6) "美国" //国家或地区
["area"]=>
string(42) "弗吉尼亚州阿什本Amazon数据中心" //所属单位或运营商
}