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

后端 未结 7 1345
情书的邮戳
情书的邮戳 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 14:00

    Well, you can't use function fseek to seek the appropriate position because it works with given number of bytes.

    I think that it's not possible without some sort of cache or going through lines one after the other.

提交回复
热议问题