Code Line Counter - Php

How to count number of lines in a PHP file ?

Snippet Code


  
Rate this page :
  [ 0 votes]

Here, count() function is used to count the number of lines in the code. Enter your file name in $file and run the program to find the lines of code.

<?php $file = "test.php"; $lines = file($file); $num = count($lines); echo "Number of lines : ".$num; ?>

Tags


Ask Questions

Ask Question