• View our reviews on Hot Scripts
  • JS Tutorial

Recent Comments

Powered by Disqus

Back to articles

Get movie information from IMDB

This function uses IMDB API, which parses IMDB files and is updated frequently. It can retrieve array with information about movie taking movie title as parameter:

function get_movie_information($name)
    $url = "".urlencode($name); 
    // send request 
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $curlData = curl_exec($curl);

    return json_decode($curlData, true);
$arr = get_movie_information("How i met your mother");

echo "<pre>";
echo "</pre>";

You may also be interested in:

Powered by

blog comments powered by Disqus