1. Go to this page and download the library: Download aharen/omdbapi 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/ */
aharen / omdbapi example snippets
use aharen\OMDbAPI();
$omdb = new OMDbAPI($api_key, $image_host, $assoc);
use aharen\OMDbAPI;
$omdb = new OMDbAPI();
$omdb->search($keyword, $type, $year);
// search for all 'series' that contain 'spider' in the title
$omdb->search('spider', 'series');
// search for all 'series' that contain 'spider' in the title and is from '2014'
$omdb->search('spider', 'series', '2014');
// get details for IMDB ID 'tt0338013'
$omdb->fetch('i', 'tt0338013');
// get details for title 'eternal sunshine'
$omdb->fetch('t', 'eternal sunshine');
stdClass Object
(
[code] => 200
[message] => OK
[data] => stdClass Object
(
[Title] => Eternal Sunshine of the Spotless Mind
[Year] => 2004
[Rated] => R
[Released] => 19 Mar 2004
[Runtime] => 108 min
[Genre] => Drama, Romance, Sci-Fi
[Director] => Michel Gondry
[Writer] => Charlie Kaufman (story), Michel Gondry (story), Pierre Bismuth (story), Charlie Kaufman (screenplay)
[Actors] => Jim Carrey, Kate Winslet, Gerry Robert Byrne, Elijah Wood
[Plot] => When their relationship turns sour, a couple undergoes a procedure to have each other erased from their memories. But it is only through the process of loss that they discover what they had to begin with.
[Language] => English
[Country] => USA
[Awards] => Won 1 Oscar. Another 64 wins & 62 nominations.
[Poster] => http://ia.media-imdb.com/images/M/MV5BMTY4NzcwODg3Nl5BMl5BanBnXkFtZTcwNTEwOTMyMw@@._V1_SX300.jpg
[Metascore] => 89
[imdbRating] => 8.4
[imdbVotes] => 533,088
[imdbID] => tt0338013
[Type] => movie
[Response] => True
)
)