Location: PHPKode > scripts > IMDB Parser > imdb-parser/example-fopen.php
<?php
/*
* Example using "file_get_contents"
* note: allow_url_fopen = On in your php.ini should be On
* safemode off
*/

//get a video detail site from imdb.com
$imdb_website = file_get_contents ('http://imdb.com/title/tt0138704/'); //movie PI


//include the parser-class
require("classes/class.imdb_parser.php");

//init the class
$IMDB_Parser = new IMDB_Parser;

// output movie-picture (html)
print "<p>".$IMDB_Parser->getMoviePictureHtml($imdb_website)."</p>";

// output movie-title
print "<br />Title: ".$IMDB_Parser->getMovieTitle($imdb_website);

// output movie-tagline
print "<br />Tagline: ".$IMDB_Parser->getMovieTagline($imdb_website);

// output movie-plot
print "<br />Plot: ".$IMDB_Parser->getMoviePlot($imdb_website);

// output movie-actors (array)
print "<br />Actors: ";
foreach($IMDB_Parser->getMovieActors($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-user rating
print "<br />User Rating: ".$IMDB_Parser->getMovieRating($imdb_website);

// output movie-languages (array)
print "<br />Languages: ";
foreach($IMDB_Parser->getMovieLanguage($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-color
print "<br />Color: ".$IMDB_Parser->getMovieColor($imdb_website);

// output movie-country (array)
print "<br />Country: ";
foreach($IMDB_Parser->getMovieCountry($imdb_website) as $value)
{
    print $value." | ";
}

// output movie-directed by
print "<br />Directed by: ".$IMDB_Parser->getMovieDirectedBy($imdb_website);

// output movie-picture path
print "<br />Picture Path: ".$IMDB_Parser->getMoviePicture($imdb_website);

// output movie-genres (array)
print "<br />Genres: | ";
foreach($IMDB_Parser->getMovieGenres($imdb_website) as $value)
{
    print $value." | ";
}
?>
Return current item: IMDB Parser