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
If you wanted to do it that way...
$line = 0; while (($buffer = fgets($fh)) !== FALSE) { if ($line == 1) { // This is the second line. break; } $line++; }
Alternatively, open it with file() and subscript the line with [1].
[1]