21,894
社区成员




$fp = fopen($fn, 'r');
while($buf = fgets($fp)) $res = $buf;
fclose($fp);
echo $res;
$fn = '你的文本文件名';
$fp = fopen($fn, 'r');
fseek($fp, -1, SEEK_END);
$s = '';
while(($c = fgetc($fp)) !== false) {
if($c == "\n" && $s) break;
$s = $c . $s;
fseek($fp, -2, SEEK_CUR);
}
fclose($fp);
echo $s;
20130721 2.02M
20130722 2.02M
20130723 2.02M
20130724 2.02M
20130725 2.02M
20130726 2.02M
20130727 2.02M
20130728 2.02M
20130729 2.02M
20130730 2.02M
20130731 2.02M
20130801 2.02M
比如这样的我想去最后一行,具体代码怎么写,给个demo,谢谢!