1. Go to this page and download the library: Download tomoehlrich/taxifarefinder 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/ */
return [
/*
|--------------------------------------------------------------------------
| TaxiFareFinder API Key
|--------------------------------------------------------------------------
|
| The TaxiFareFinder API Key can be requested at
| https://www.taxifarefinder.com/contactus.php
|
*/
'api_key' => env('TAXIFAREFINDER_API_KEY', ''),
];
$tff = new TaxiFareFinder('<YOUR API KEY>');
return $tff->getNearestCity(1.290270, 103.851959);
/*
This function returns the following array:
Array
(
[name] => Singapore
[full_name] => Singapore, Singapore
[handle] => Singapore
[locale] => zh_SG
[distance] => 7747
)