...

View Full Version : if true go to next line



eon201
11-08-2007, 06:19 PM
Hi,

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}

else{}



Can anyone help with this please??

Thanks. Eon201

Inigoesdr
11-08-2007, 07: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum