I want to count number of files in a php file. I am using CodeIgniter framework. Currently I have tried this below
$file='contractor.php';
$mypath= 'application/controller/'.$file;
$linecount = 0;
$handle = fopen($mypath, "r");
while(!feof($handle)){
$line = fgets($handle);
$linecount++;
}
fclose($handle);
echo $linecount;
Currently after executing the file in a function it keeps loading. i want to find number of lines in the file.like output: 202