1. Go to this page and download the library: Download vfalies/tmdb 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/ */
vfalies / tmdb example snippets
facTmdb\Factory;
use VfacTmdb\Search;
use VfacTmdb\Item;
// Initialize Wrapper
$tmdb = Factory::create()->getTmdb('your_api_key');
// Search a movie
$search = new Search($tmdb);
$responses = $search->movie('star wars');
// Get all results
foreach ($responses as $response)
{
echo $response->getTitle();
}
// Get movie information
$item = new Item($tmdb);
$infos = $item->getMovie(11, array('language' => 'fr-FR'));
echo $infos->getTitle();
VfacTmdb\Tmdb;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$logger = new Logger('default', [new StreamHandler('php://stdout')])
$tmdb = Tmdb('your_api_key', $logger);
$search = new Search($tmdb);
$responses = $search->movie('star wars');
$item = new Item($tmdb);
$movie = $item->getMovie($movie_id);
echo $movie->getTitle();
$search = new Search($tmdb);
$responses = $search->tvshow('game of thrones');
$item = new Item($tmdb);
$tvshow = $item->getTVShow($tvshow_id);
echo $tvshow->getTitle();
$item = new Item($tmdb);
$tvseason = $item->getTVSeason($tvshow_id, $season_number);
echo $tvseason->getName();