Re: stripping of the last character
| From: | Sebastian | Date: | Mon, 18 Apr 2005 11:22:49 +0000 |
| Subject: | Re: stripping of the last character | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-213258@lists.php.net to get a copy of this message | ||
$recipients = 'jim@email.com,pat@email.com,kevin@email.com,';
echo str_replace(',', ', ', substr($recipients, 0, -1));
----- Original Message -----
From: "Ross" <ross@aztechost.com>
> I have a large group of email addesses serperated by commas. I need to
trim
> off the very last comma
>
> $recipients = jim@email.com,pat@email.com,kevin@email.com,
>
>
> Also how would I add a space after every comma? to give
>
> jim@email.com, pat@email.com, kevin@email.com
>
>
> many thanks,
>
> Ross