Try this,
$fileStr = file ("your file");
sizeof ($fileStr);
file (); returns the file in an array. Each element of the array corresponds to a line in
the file, with the newline still attached.
Thus now using the function sizeof() You may
count all the lines.
Bye.