<?php

echo 'im here <br/>';
require_once 'vendor/autoload.php';
use GeoIp2\Database\Reader;

// This creates the Reader object, which should be reused across
// lookups.
$reader = new Reader('geoip_databases/GeoLite2-City.mmdb');

// Replace "city" with the appropriate method for your database, e.g.,
// "country".
$record = $reader->city('82.155.109.181');

print('Country-Iso: ' . $record->country->isoCode . "<br/>");
print('Country-Name: ' . $record->country->name . "<br/>"); 
print($record->country->names['pt-PT'] . "<br/>"); 

print('Subdivision-Name: ' . $record->mostSpecificSubdivision->name . "<br/>"); 
print('Subdivision-Iso: ' . $record->mostSpecificSubdivision->isoCode . "<br/>");

print('City-Name: ' . $record->city->name . "<br/>");

print'City-PostalCode: ' . ($record->postal->code . "<br/>");

print('Latitude: ' . $record->location->latitude . "<br/>");
print('Longitude: ' . $record->location->longitude . "<br/>");
