PHP program to Count number of lines in a file

bookmark

<?php
$file = basename($_SERVER['PHP_SELF']); 
$no_of_lines = count(file($file)); 
echo "There are $no_of_lines lines in $file"."\n";
?>


Output:

There are 5 lines in a6924e70-5a4c-11e7-b47b-99347412a245.php