1. Go to this page and download the library: Download playtini/geoip 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/ */
echo $geoIp->maxMindCountry('80.231.192.1') . "\n"; // CA
echo $geoIp->ip2LocationCountry('80.231.192.1') . "\n"; // DZ
echo $geoIp->country('80.231.192.1') . "\n"; // DZ - IP2Location has higher priority
echo $geoIp->country('80.231.192.1', ['BR', 'MX']) . "\n"; // DZ
// IP2Location still has higher priority, MaxMind country is not among preferred countries
echo $geoIp->country('80.231.192.1', ['CA', 'AU']) . "\n"; // CA
// MaxMind country is among preferred countries; it is used instead of different IP2Location country
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.