Re: split() - not working in this case
| From: | Bas Jobsen | Date: | Sun, 08 Sep 2002 07:53:14 +0000 |
| Subject: | Re: split() - not working in this case | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115646@lists.php.net to get a copy of this message | ||
<?
function split_addresses($addr) {
$ad = array();
$ad = split(",",$addr);
return $ad;
}
$tos=array();
$to = " abcd <abcd@asd.net>, efgh <xxx@xxx.com>";
$tos=split_addresses($to);
echo $tos[1];
?>
echos efgh <xxx@xxx.com> ?? Whats the problem? Maybe you output to a browser
and don't see <xxx@xxx.com> cause its between <>
Op zondag 08 september 2002 10:17, schreef N. Pari Purna Chand:
> I have a string
> $to = " abcd <abcd@asd.net>, efgh <xxx@xxx.com>" ;
>
> I want a function returning an array of
> indivial names+mailids like from the $to seperated by ","
> something like
> $tos[0] = "abcd <abcd@asd.net>";
> $tos[1] = "efgh <xxx@xxx.com>";
>
> Now split() in the following function*** is notworking as needed.
> ie, I'm getting
> $tos[0] = "abcd";
> $tos[1] = "efgh";
>
> Not the complete name + <mailid>,
> Why ?
> /Chandu
>
> ***
> function split_addresses($addr) {
> $ad = array();
> $ad = split(",",$addr);
> return $ad;
> }