View Full Version : if true go to next line

11-08-2007, 07:19 PM

Im looking for a function that allows me to get to the nest line of a file that is read if something is true eg...

$fp = fopen($filename, "r"); //Open the server log
$content = fread($fp, filesize($filename)); // Read the server log
$content = explode("\n", $content); // explode into array
$content = array_reverse($content ); // reverse the array

$a = 2;
if ($a <3 'then goto next line of file'){
then do some stuff in here}


Can anyone help with this please??

Thanks. Eon201

11-08-2007, 08:34 PM
fgets (http://php.net/fgets) will get the next line in the file pointer. There's an example with a loop on the manual page.