$a=file('mytext.txt');
$n=count($a);
print "В файле mytext.txt ".$n." строк";