Welcome folks today in this blog post we will be
counting the number of lines inside the text file using
php 7. All the full source code of the application is shown below.
In order to get started you need to make an
index.php file and copy paste the following code
<?php $my_text_file = "mytextfile.txt"; $all_lines = file($my_text_file); $number_of_lines= count($all_lines); echo $number_of_lines; ?>