note 27170 rejected from function.fgetc by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Tue, 26 Nov 2002 00:32:07 +0000 |
| Subject: | note 27170 rejected from function.fgetc by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39967@lists.php.net to get a copy of this message | ||
For some reason fgetc doesn't like printing out the character 0 (zero) and will skip it
completely if you're parsing a text file. Perhaps it's just dodgy only for me, but
i've had to work around it thusly:
while (($c = fgetc($file)) || ($c == 0)) {
if ($c == "\t") { echo " <B>tab</B> "; }
if ($c == "\n") { echo "newline<BR>"; }
else { echo "$c"; }
}
Someone please tell me, if possible, why i need the extra OR || statement in there to make it print
zeroes
---- Dinger