PHP: Read Specific Line From File

后端 未结 12 654
天命终不由人
天命终不由人 2020-11-28 08:15

I\'m trying to read a specific line from a text file using php. Here\'s the text file:

foo  
foo2

How would I get the content of the seco

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 08:53

    Use stream_get_line: stream_get_line — Gets line from stream resource up to a given delimiter Source: http://php.net/manual/en/function.stream-get-line.php

提交回复
热议问题