split() - not working in this case
| From: | N. Pari Purna Chand | Date: | Sun, 08 Sep 2002 08:17:23 +0000 |
| Subject: | split() - not working in this case | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-115645@lists.php.net to get a copy of this message | ||
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;
}