11 lines
242 B
PHP
11 lines
242 B
PHP
<?php
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
use GeoIp2\Database\Reader;
|
|
$reader = new Reader(base_path().'/geoip/GeoLite2-City/GeoLite2-City.mmdb');
|
|
|
|
$record = $reader->city('128.101.101.101');
|
|
|
|
print($record->country->isoCode);
|
|
|
|
|
|
?>
|