feof Question
| From: | Harish | Date: | Sun, 09 May 2004 16:30:53 +0000 |
| Subject: | feof Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185751@lists.php.net to get a copy of this message | ||
Hi
I am using Linux, Apache, MySql, PHP. In the below mentioned code example when the counter data that
is displayed on the screen going to a indefinite loop. The file that is read has got sufficient
permissions.
What are the reasons and how do I tackle the problem?
<?php
$fp = fopen( 't.txt', 'r' );
while( !feof( $fp ) )
{
print fgets( $fp );
echo $counterval++;
if($counterval%100==0)
{
flush();
}
}
fclose( $fp );
?>
Regards,
Harish Rao K