How do I open a file from line X to line Y in PHP?

后端 未结 7 1343
情书的邮戳
情书的邮戳 2020-11-29 13:09

The closest I\'ve seen in the PHP docs, is to fread() a given length, but that doesnt specify which line to start from. Any other suggestions?

7条回答
  •  被撕碎了的回忆
    2020-11-29 13:51

    Here is the possible solution :)

    = $startLine) {
            echo $line;
        }
        if ($lineNo == $endLine) {
            break;
        }
    }
    fclose($f);
    ?>
    

提交回复
热议问题