PHP code example of alexpechkarev / google-geocoder
1. Go to this page and download the library: Download alexpechkarev/google-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.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
return [
/*
|--------------------------------------------------------------------------
| Google Geocoder
|--------------------------------------------------------------------------
| Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA")
| into geographic coordinates (like latitude 37.423021 and longitude -122.083739),
| which you can use to place markers or position the map.
|
*//*
|--------------------------------------------------------------------------
| Application Key
|--------------------------------------------------------------------------
|
| Your application's API key. This key identifies your application for
| purposes of quota management. Learn how to get a key from the APIs Console.
*/'applicationKey' => 'my-api-key',
/*
|--------------------------------------------------------------------------
| Request URL
|--------------------------------------------------------------------------
|
*/'requestUrl' => [
'json' => 'https://maps.googleapis.com/maps/api/geocode/json?',
'xml' => 'https://maps.googleapis.com/maps/api/geocode/xml?'
],
];