PHP code example of baraja-core / geocoder

1. Go to this page and download the library: Download baraja-core/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/ */

    

baraja-core / geocoder example snippets


$geocoder = new \Baraja\Geocoder\Geocoder();
$coordinates = new $geocoder->decode('Náměstí Míru Praha');

echo $coordinates->getLatitude(); // 50.075075836281066
echo $coordinates->getLongitude(); // 14.437529917970826