l**********n 发帖数: 8443 | 1 why?
I am reading a binary file from a sftp resource.
while (!feof($file)) {
$content = fread($file, 1024 * 10);
$bytes_read = strlen($content);
if($bytes_read == 0) break;
print_r("read bytes: ".$bytes_read."n");
fwrite($newfile, $content, 1024 * 10);
}
if I leave out the $bytes_read, it becomes an infinite loop. |
|