Write a PHP script to count number of lines in a file.



code:-

<?php $file="index.php"; $count = count(file($file)); echo $count lines in $file"."\n"; ?>

output:-

10 lines in index.php


Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post