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
You could do like:
$lines = file($filename); //file in to an array echo $lines[1]; //line 2
OR
$line = 0; $fh = fopen($myFile, 'r'); while (($buffer = fgets($fh)) !== FALSE) { if ($line == 1) { // $buffer is the second line. break; } $line++; }