PHP code example of biscolab / geocoder

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

    

biscolab / geocoder example snippets


$address = 'street <YOUR_STREET>, <YOUR_CITY>, <YOUR_COUNTRY>';

$loc = (new Geocoder($address))->getLocation();

/**
 * Return the latitude
 *
 * @return float
 */
$lat = $loc->getLat();

/**
 * Return the longitude
 *
 * @return float
 */
$lng = $loc->getLng();