Hello, I saw the benefits of a geotargeting tool in CPA and I really want to use one for free, can you help me?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: this_feature_currently_requires_accessing_site_using_safari
<?php
$ip = ($_SERVER['REMOTE_ADDR']);
require_once("geoip2.phar");
use GeoIp2\Database\Reader;
$reader = new Reader('GeoLite2-City_20201006/GeoLite2-City.mmdb');
$record = $reader->city($ip);
//$_SERVER['REMOTE_ADDR']);
// or for Country DB
// $reader = new Reader('/path/to/GeoLite2-Country.mmdb');
// $record = $reader->country($_SERVER['REMOTE_ADDR']);
//print($record->country->isoCode . "\n");
//print($record->country->name . "\n");
//print($record->country->names['zh-CN'] . "\n");
//print($record->mostSpecificSubdivision->name . "\n");
//print($record->mostSpecificSubdivision->isoCode . "\n");
//print($record->city->name . "\n");
//print($record->postal->code . "<p>");
$country_isoCode = ($record->country->isoCode);
$state = ($record->mostSpecificSubdivision->isoCode);
$city = ($record->city->name);
$postal = ($record->postal->code);