Re: separating data from a flat file

From: Date: Sat, 24 Aug 2002 06:24:06 +0000
Subject: Re: separating data from a flat file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113897@lists.php.net to get a copy of this message
$fp = fopen($file,"r"); while (!feof ($fp)) { $buffer = fgets($fp, 4096); if(strstr($buffer, '@www.') === false)){ $other[] = $buffer; }else{ $www[] = $buffer; } } fclose ($fp); Justin Garrett <rdkurth@starband.net> wrote in message news:33182731804.20020823213049@starband.net... > I have a flat file that has multiple lines if e-mail address one address per > line. The file looks something like this > user@www.domain.com > user5@www.domain.com > user2@domain1.net > user3@domain2.net > ruser4@domain3.com > > I want to pull the data out of this file and display all the e-mail > without the www in one place on the screen and all address with www in > another place's > This is what I am using to get the data out of the file I just can't > figure out how to separate the data. > > $fp = fopen($file,"r"); > while (!feof ($fp)) { > $buffer = fgets($fp, 4096); > echo $buffer; > echo "<br>"; > } > fclose ($fp); > > > > > > > -- > Best regards, > rdkurth mailto:rdkurth@starband.net >

« previous php.general (#113897) next »