可以用以下办法生成测试文件
复制代码 代码如下:
$file_handle = fopen("./csdn.txt", "rb+");
for ($index1 = 1; $index1 <= 2000000; $index1++) {
fwrite($file_handle, 'http://jb51.net'.$index1."r");
}
fclose($file_handle);
读取处理代码如下:
复制代码 代码如下:
$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);
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!