Last active
August 29, 2015 14:04
-
-
Save pinscript/34eabb6f74b88106d113 to your computer and use it in GitHub Desktop.
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
<?php | |
$search = 'annonsmannen'; | |
$fileName = 'movies.list'; // From ftp://ftp.sunet.se/pub/tv+movies/imdb/movies.list.gz | |
$fp = fopen($fileName, 'r'); | |
for(;;) { | |
$line = fgets($fp); | |
if($line === false) { | |
print('Reached end of file. Movie not found'); | |
break; | |
} | |
if(stripos($line, $search) !== false) { | |
printf('Movie found: %s', $line); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment