Menu
hi
i have a loop where i read values line by line from file
something like:
[code=php]
while(!feof($fp))
{
$l=fgets($fp);
echo($l);
}
[php]
i noticed that when i read ordinary ascii file feof() ends the loop as it should but when i read utf-8 file, the loop does additinal iteration so i read some garbage and get errors and warning…
so for reading unicode files without errors i use this loop:
(i’m assuming filesize()>0)
[code=php]
do
{
$l=fgets($fp);
if(feof($fp))
break;
echo($l);
}while(!feof($fp));
[php]
and then it works fine…
Is it some known issue?