if the file's not too long, you could use file() to read the file into
memory, then loop through the array you get back and look for the line(s)
you're after.

if you don't want to read the entire file into memory, you can loop through
the file with:

$f = fopen($file, "r") or die("can't open file");
while (!foef($f))
{
  $line = fgets($f, 1024);  // increase length if your lines are longer
  // line checking code here
}
fclose($f);

HTH

-----Original Message-----
From: Uma Shankari T. [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 2:55 PM
To: PHP
Subject: [PHP] Files




Hello,

  Can anyone please clear my doubt...
I am having the input data in one file.
i need check whether some lines are there continuosly in that file and i
have to extract that line using file operation commands in php..how do i
go about with that ?? can anyone please tell me

Waiting for your reply
Uma



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to