PHP code example of geocoder-php / free-geoip-provider
1. Go to this page and download the library: Download geocoder-php/free-geoip-provider 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/ */
geocoder-php / free-geoip-provider example snippets
$httpClient = new \Http\Discovery\Psr18Client();
// Use the default provider (https://freegeoip.app)
$provider = new Geocoder\Provider\FreeGeoIp\FreeGeoIp($httpClient);
// Or provide the endpoint of your instance
$provider = new Geocoder\Provider\FreeGeoIp\FreeGeoIp($httpClient, 'http://my.internal.geocoder/json/%s');