Recommended:

  • phpclasses.org
  • jsclasses.org
  • jsmag.com
  • siteapps.com
  • View our reviews on Hot Scripts
  • JS Tutorial
  • scripts.com
  • securesignup.com




Recent Comments

Powered by Disqus




Back to articles

Get movie information from IMDB

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

<?php
function get_movie_information($name)
{
    $url = "http://www.deanclatworthy.com/imdb/?q=".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);
    curl_close($curl);

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

echo "<pre>";
print_r($arr);
echo "</pre>";
?>

You may also be interested in:

Powered by BlogAlike.com

blog comments powered by Disqus