You can also count from the start, i.e.;
function flineseek($fp, $line) {
for ($x = 0; $x < $line; $x++)
$void = fgets($fp, 4096);
}
$fp = fopen($file, "r");
$line = 0;
while ($oneLine = fgets($fp, 4096)) {
$line++;
// do something with $oneLine
if (something) $savedLine = $line;
}
fclose($fp);
Now, open it again,
$fp = fopen($file, "r");
flineseek($fp, $savedLine);
// do something
fclose($fp);
.. and you're done.. (?)