1. Go to this page and download the library: Download socloz/geocoder 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/ */
socloz / geocoder example snippets
php
php
php
$adapter = new \Geocoder\HttpAdapter\BuzzHttpAdapter();
php
$buzz = new \Buzz\Browser(new \Buzz\Client\Curl());
$adapter = new \Geocoder\HttpAdapter\BuzzHttpAdapter($buzz);
php
$geocoder = new \Geocoder\Geocoder();
$geocoder->registerProviders(array(
new \Geocoder\Provider\YahooProvider(
$adapter, '<YAHOO_API_KEY>', $locale
),
new \Geocoder\Provider\IpInfoDbProvider(
$adapter, '<IPINFODB_API_KEY>'
),
new \Geocoder\Provider\HostIpProvider($adapter)
));