Last active
August 29, 2015 14:06
-
-
Save gupul2k/2aeb41a8b24808e8e274 to your computer and use it in GitHub Desktop.
Read_MovieList_Call_IMDBAPI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jo Jeeta Wohi Sikandar, 1992 | |
Titanic, 1992 | |
Dhadkan, 2000 | |
Mohabbatein, 2000 | |
Har Dil Jo Pyaar Karega, 2000 | |
Bichhoo, 2000 | |
Pukar, 2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<?php | |
$myfile =fopen("movie_list.txt", "r") or die("Unable to open file!"); | |
while (!feof($myfile)) { | |
$line = fgets($myfile); | |
$pos = strrpos($line, ","); | |
$movie=substr($line, 0, $pos); | |
$year=substr($line, $pos+1, strlen($line)); | |
$year=trim($year); | |
$movie = str_replace(' ', '%', trim($movie)); | |
//echo $movie.$year; | |
$json=file_get_contents("http://www.omdbapi.com/?t=$movie&y=$year"); | |
$info=json_decode($json); | |
print_r($info); | |
echo '<br/>'; | |
} | |
fclose($myfile); | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment