RE: [PHP] Files

From: Date: Fri, 07 Jun 2002 04:52:29 +0000
Subject: RE: [PHP] Files
Groups: php.general 
Request: Send a blank email to php-general+get-101088@lists.php.net to get a copy of this message
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:umashankari@lantana.tenet.res.in] 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

« previous php.general (#101088) next »