this function returns the Boolean values if the file pointer is located at the beginning of the file.
<?php
$fp = fopen("myfile.txt","r");
$count=0;
while(!feof($fp))
{
echo fgets($fp);
$count++;
}
echo "<br>" total lines are $count";
?>
<?php
$fp = fopen("myfile.txt","r");
$count=0;
while(!feof($fp))
{
echo fgets($fp);
$count++;
}
echo "<br>" total lines are $count";
?>