<?php
#movies.php
if($argc > 1) {
$movie_file = $argv[1];
}
else $movie_file = "movies.txt";
$data = file($movie_file,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
foreach ($data as $movie) {
echo " *" . $movie . "\n";
}
Run this from the command line:
php movies.php path_to_movies_list > output_page
If no path to the movies list is give, then the script uses movies.txt, assumed to be in the same directory as the script.