日期:2014-05-17 浏览次数:20418 次
$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;