note 34958 deleted from function.fread by didou

From: Date: Wed, 13 Aug 2003 10:39:20 +0000
Subject: note 34958 deleted from function.fread by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54070@lists.php.net to get a copy of this message
Note Submitter: ---- An example above is wrong! <?php $handle = fopen ("http://www.php.net/", "rb"); $contents = ""; do { $data = fread ($handle, filesize ($filename)); if (strlen($data) == 0) { break; } $contents .= $data; } fclose ($handle); ?> Should read: <?php $handle = fopen ("http://www.php.net/", "rb"); $contents = ""; do { $data = fread ($handle, 1024)); $contents .= $data; } while (strlen($data) > 0); fclose ($handle); ?> -- Jamie Burns SSL Certificates from http://www.bluessl.com/

« previous php.notes (#54070) next »