Howdy,
as the fread-function is now working properly again, I'd like to suggest
an update to the fread manual page.
The example provided for reading from a stream is both erroneous,
because it will throw an error and IMHO also not well coded :-)
Some comments on that page already reflect that and thus the update
should be done...
Best regards,
Alexander
--- fread.xml.old 2003-05-31 20:02:59.000000000 +0200
+++ fread.xml 2003-05-31 20:02:59.000000000 +0200
@@ -80,13 +80,9 @@
<?php
$handle = fopen ("http://www.php.net/", "rb");
$contents = "";
-do {
- $data = fread ($handle, filesize ($filename));
- if (strlen($data) == 0) {
- break;
- }
- $contents .= $data;
-} while(true);
+while (!feof($handle)) {
+ $contents .= fread ($handle, 1024);
+}
fclose ($handle);
?>
]]>
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php