Write a PHP script to count number of lines in a file.
<?php $file = basename($_SERVER['PHP_SELF']); $no_of_lines = count(file($file)); echo "There are $no_of_lines lines in $file"."\n"; ?>
Sample Output:
There are 5 lines in a6924e70-5a4c-11e7-b47b-99347412a245.php
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer