PHP code example of yrizos / distance

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

    

yrizos / distance example snippets


"    "yrizos/distance": "*"
}

$api = new \DistanceMatrix\Api('apikey');

$api->addDestination('Αγιου Γεωργίου 5, Θέρμη, Θεσσαλονίκη');

$api->addOrigin('Αριστοτέλους 35, Εύοσμος, Θεσσαλονίκη');

$api->setUnits('imperial');

$api->setOutput('xml');

$api->setMode('walking');

$api->setLanguage('el');

$results = $api->run();