Pages

feof in php example

Monday, 25 March 2013

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";
?>
 

Most Reading