1. Go to this page and download the library: Download tims/zomato-php-sdk 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/ */
tims / zomato-php-sdk example snippets
use Tims\Zomato\ZomatoClient;
$zomato = new ZomatoClient(getenv('ZOMATO_USER_KEY'));
$zomato = new ZomatoClient(
userKey: $userKey,
baseUrl: 'https://developers.zomato.com/api/v2.1',
);
use Tims\Zomato\ApiException;
use Tims\Zomato\ZomatoClient;
try {
$data = (new ZomatoClient($userKey))->restaurant(16506740);
} catch (ApiException $e) {
$e->getStatusCode(); // HTTP status
$e->getResponseBody(); // raw body
$e->getResponseHeaders(); // response headers
$e->getMessage();
}
use Tims\Zomato\Enums\EntityType;
use Tims\Zomato\Enums\Order;
use Tims\Zomato\Enums\Sort;
EntityType::City;
Sort::Rating;
Order::Desc;