2019-11-21 10:13:19 +08:00

20 lines
388 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require 'Ip2Region.php';
$ip2region = new Ip2Region();
$ip = '61.140.232.170';
echo PHP_EOL;
echo "查询IP{$ip}" . PHP_EOL;
$info = $ip2region->btreeSearch($ip);
var_export($info);
echo PHP_EOL;
$info = $ip2region->memorySearch($ip);
var_export($info);
echo PHP_EOL;
// array (
// 'city_id' => 2163,
// 'region' => '中国|华南|广东省|深圳市|鹏博士',
// )