Re: What's wrong with this code please?
| From: | Adam Bregenzer | Date: | Tue, 24 Feb 2004 17:59:18 +0000 |
| Subject: | Re: What's wrong with this code please? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178744@lists.php.net to get a copy of this message | ||
On Tue, 2004-02-24 at 12:51, Donpro wrote:
> $emails = array("email1@domain.com","email2@domain.com",email3@domain.com);
> $addresses = explode(",",$emails);
> for ($i=0; $i < count($addresses); $i++) {
> echo $i . ': ' . $addresses[$i] . '<br>';
> if ($i == count($addresses) - 1)
> $form['recipient'] .= $addresses[$i];
> else
> $form['recipient'] .= $addresses[$i] . ',';
> }
> echo 'Recipient = ' . $form['recipient'] . '<br>';
>
>
> The output I am receiving is:
> 0: Array
> Recipient = Array
>
> Obviously, I want to see the output of each array element as well as the
> final contents of $form['recipient'].
You need to look up how to use explode[1], my guess is you don't want to
use it at all here. In fact, implode[2] may be exactly what you are
looking for.
Regards,
Adam
[1] http://www.php.net/explode
[2] http://www.php.net/implode
--
Adam Bregenzer
adam@bregenzer.net
http://adam.bregenzer.net/