You are here: Re: [PHP] getting the email addresses in a sendable format. « PHP « IT news, forums, messages
Re: [PHP] getting the email addresses in a sendable format.

Posted by Paul Waring on 07/11/05 13:32

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация