Movie Details Functions
Movie Details comes with a set of PHP functions which are designed to allow developers to easily implement movie data into their website. The list below shows the most important functions.
Available Functions
md_get_movie($imdb_id_or_title, $options)
md_get_movie_detail($imdb_id_or_title, $detail)
md_get_movie_details($imdb_id_or_title, $details)
md_get_movie($imdb_id_or_title, $options)
- $imdb_id_or_title (string): Movie title or its corresponding ID on IMDb.com
- $options (array):
- cache: (bool) Cache movie details in MySQL database. Default:
true
- cache: (bool) Cache movie details in MySQL database. Default:
Returns: (object) MD_Movie object
Example
<?php
$movie_title = "Gone Girl";
$movie = md_get_movie($movie_title, $options);
echo "The movie " . $movie->title . "was released in " . $movie->released ".";
md_get_movie_detail($imdb_id_or_title, $movie_detail)
- $imdb_id_or_title (string): Movie title or its corresponding ID on IMDb.com
- $movie_details (string): A movie detail. See the "Movie Details" page for a list of available names
Returns: (string | array | int | bool) Value of the movie detail
Example
<?php
$movie_imdb_id = "tt2421662";
$movie_detail = "directors";
$directors = md_get_movie($movie_imdb_id, $movie_detail);
echo "<ul>";
foreach($directors as $director) {
?>
<li><?php echo $director; ?><li>
<?php
}
echo "</ul>";
md_get_movie_details($imdb_id_or_title, $movie_details)
- $imdb_id_or_title (string): Movie title or its corresponding ID on IMDb.com
- $movie_details (array): Array specifying the movie details that should be returned
Returns: (array) Array containing the movie details and their values