PHP code example of f3ath / simpleuber

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

    

f3ath / simpleuber example snippets



r = new \F3\SimpleUber\Uber('your server token');

try{
    var_dump($uber->getProducts(37.773972, -122.431297));
    var_dump($uber->getPriceEstimates(37.773972, -122.431297, 37.333333, -121.9));
    var_dump($uber->getTimeEstimates(37.773972, -122.431297));
} catch (\F3\SimpleUber\ApiException $e) {
    var_dump($e->getErrorMessage());
    var_dump($e->getErrorCode());
}