// 获取指定开始行数$page,跨度$step的文件内容
function getLine($file_name, $start, $limit)
{
    $f = new SplFileObject($file_name, 'r');
    $f->seek($start);
    $ret = "";
    for ($i = 0; $i < $limit; $i++) {
        try {
            $ret .= $f->getCurrentLine();
            $f->next();
        } catch (Exception $e) {
            break;
        }
    }
    return $ret;
}

相关文章:

  • 2022-12-23
  • 2021-06-22
  • 2021-09-12
  • 2021-09-27
  • 2021-12-13
  • 2021-11-21
  • 2021-12-05
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案