Reading specific line of a file in PHP

前端 未结 6 1564
攒了一身酷
攒了一身酷 2020-12-11 05:33

I am working on reading a file in php. I need to read specific lines of the file.

I used this code:

fseek($file_handle,$start);
while (!feof($file_ha         


        
6条回答
  •  我在风中等你
    2020-12-11 06:12

    You must read from the beginning. But if the file never/rarely changes, you could cache the line offsets somewhere else, perhaps in another file.

提交回复
热议问题