PHP code example of adrenth / thetvdb

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

    

adrenth / thetvdb example snippets

`
$client->setCacheTtl(3600); // in seconds
`
$language = new Language('nl');

echo $language->getCode();
// 'nl'
echo $language->getLabel();
// 'Nederlands'

$language = $client->getUserPreferredLanguage($accountId);
`
$rating = $client->addUserRatingForEpisode($accountId, $episodeId, $rating);
$rating = $client->removeUserRatingForEpisode($accountId, $episodeId);
$rating = $client->addUserRatingForSeries($accountId, $seriesId, $rating);
$rating = $client->removeUserRatingForSeries($accountId, $seriesId);

echo $rating->getUserRating();
// 7
echo $rating->getCommunityRating();
// 7.65
`
$language = new Language('nl');
$response = $client->getSeries('Ray Donovan', $language, $accountId);
$seriesCollection = $response->getSeries();

foreach ($seriesCollection as $series) {
	echo $series->getName();
}

$response = $client->getSeriesByImdbId('tt0290978');
$response = $client->getSeriesByImdbId('tt0290978', new \Adrenth\Thetvdb\Language('de'));
$response = $client->getSeriesByZap2itId('EP01579745', new \Adrenth\Thetvdb\Language('nl'));