如何在有限的内存中读取大文件

$i = 0;
$now = '';
while ($i >= 0) {
    if ($i>10) {
        break;
    }
    fseek($file_handle, 0, SEEK_CUR);
    $now = fgetc($file_handle);//可以自己写个判断false表示文件到头
    if ($now == "\r") {
        echo '找到断点';
    }
    echo $now;
    $i++;
}
fclose($file_handle);

 

posted @ 2014-07-11 21:46  timily  阅读(248)  评论(0编辑  收藏  举报