This is similar to the last one I wrote, but this one tells the person how many lines are in a text file instead of how many files are in a directory. This can be useful on an informational site to forwarn or inform the reader of how to prepare for a long, or short read
<?
//specify the filename
$filename = "myfile.txt";
$lines = file($filename);
$count = count($lines);
//show the result
echo("There are $count lines in the file");
?>