$file = $handledir.'/venocap.1';
$fp = fopen($file, "r");
$line = 100;
$pos = -2;
$t = " ";
$data = "";
while ($line > 0) {
while ($t != "\n") {
$flag=fseek($fp, $pos, SEEK_END);
if (fseek($fp, $pos, SEEK_END)==-1){
//fseek($fp, 0);
rewind($fp);
$t="\n";
$line=0;
}else{
$t = fgetc($fp);
$pos --;
}
}
$t = " ";
$line --;
}
while (!feof($fp)) {
$data .= fgets($fp);
$data.='<br/>';
}
fclose ($fp);
echo $data
php读取大文件,后多少行的数据
最新推荐文章于 2021-03-28 21:44:04 发布