RE: [PHP] How to loop?
| From: | Chris W. Parker | Date: | Mon, 11 Aug 2003 22:59:43 +0000 |
| Subject: | RE: [PHP] How to loop? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159207@lists.php.net to get a copy of this message | ||
John Taylor-Johnston <mailto:taylorjo@collegesherbrooke.qc.ca>
on Monday, August 11, 2003 3:08 PM said:
> I understand the principle of mail. What I want to do is use a
> <textarea> as a mailing list, something like this. How do I loop it?
I would...
$addresses = explode("\n",$_GET['addresses']);
foreach($addresses as $address)
{
mail($address,...);
}
That is going to take data like:
user@hotmail.com
user@yahoo.com
weiner@sco.com
and split it into an array ($addresses) using the endline character (\n)
as the delimiter.
HTH!
Chris.