A quick way.
$all_lines = file('filename.txt');
$total_lines = count($all_lines);
echo 'Total lines :' . $total_lines;
or
$counter = 0;
$fp = fopen('filename.txt','r');
while(!feof($fp)) {
$tmp = fgets($fp); $counter++;
}
fclose($fp);
echo 'Total lines: '.$counter;
There will probably be more efficient ways of doing this, but these were the first two off my head.