1. Go to this page and download the library: Download rooxie/omdb 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/ */
rooxie / omdb example snippets
$omdb = new Rooxie\OMDb(
new \GuzzleHttp\Client(),
new \GuzzleHttp\Psr7\HttpFactory(),
'your-api-key'
);
$movie = $omdb->getByTitle('harry potter', \Rooxie\Enum\TitleType::MOVIE, 2004);
// {"Title":"Harry Potter and the Prisoner of Azkaban","Year":"2004","Rated":"PG","Released":"04 Jun 2004" ...
echo $movie->getBody()->getContents();