|
Posted by AnrDaemon on 10/21/07 13:56
Greetings, gezerpunta.
In reply to Your message dated Thursday, October 18, 2007, 18:59:31,
g> I need a regex code for parsing this string to an email array
g> "mnp test" <celo@tum.com>,"test testt"
g> <otur@par.com>,sett@tttt.com,test@twest.com
Something like
<?php
$s = '"mnp test" <celo@tum.com>,"test testt" <otur@par.com>, sett@tttt.com,test@twest.com';
if(preg_match_all('#[\s\,]<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi', $s, $ta))
{
var_export($ta[1]);
}
?>
--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>
Navigation:
[Reply to this message]
|