Re: getting the email addresses in a sendable format.

From: Date: Mon, 11 Jul 2005 10:32:05 +0000
Subject: Re: getting the email addresses in a sendable format.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218428@lists.php.net to get a copy of this message
On Mon, Jul 11, 2005 at 11:20:05AM +0100, Ross wrote: > But I have having trouble assiging them to the variable $recipients. Really > what i want is to convert > > $email_addresses[0] = name0@domain.com > $email_addresses[1] = name1@domain.com > $email_addresses[2] = name2@domain.com > > into > > $recipients= "name0@domain.com, name1@domain.com, name2@domain.com"; You want the implode() function using a line like this: $recipients = implode(', ', $email_addresses); This will create a string of all the values in each element of the $email_addresses array, separated by a comma and a space (of course you can change this to anything you want). You can find more information about the function here: http://www.php.net/implode > (ii) does the space between addresses matter? I would rather have it as my > user could see the recipeints more clearly. As far as I'm aware, any standards compliant mail server will just ignore the extra whitespace so you are free to insert spaces if you so desire. Paul -- Rogue Tory http://www.roguetory.org.uk

« previous php.general (#218428) next »