separating data from a flat file
| From: | rdkurth at starband dot net | Date: | Sat, 24 Aug 2002 04:30:49 +0000 |
| Subject: | separating data from a flat file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113895@lists.php.net to get a copy of this message | ||
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