note 12202 deleted from function.fgets by irc-html

From: Date: Tue, 22 Jan 2002 23:07:30 +0000
Subject: note 12202 deleted from function.fgets by irc-html
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-25712@lists.php.net to get a copy of this message
WARNING! I have been scratching my head for over a month as to why my script kept returning ZERO SIZED REPLY error rather than a html document. The problem was this: $contents .= fgets($fd, 10000000); Naively I assumed that setting the max string size to 10000000 would simply make sure that PHP grabbed the entire line from the file. It looks like there's some kind of bug, because it doesn't do that; nor does it return a PHP error message. All you get is a "ZERO SIZED REPLY" HTTP error message, which isn't very informative at all. Now instead I use: $contents .= fgets($fd, filesize($filename)); which still ensures that I will grab as much as is needed. ($fd points to the file specified by $filename.)

« previous php.notes (#25712) next »