Similar to this question, how could I parse e-mail addresses which are in this format,
"Bob Smith" <[email protected]>, [email protected], "John Doe"<[email protected]>
And get the a result like this:
array( '[email protected]'=>'Bob Smith' '[email protected]'=>'' '[email protected]'=>'John Doe' );
Well, you could use mailparse_rfc822_parse_addresses(), which does exactly that. It's a PECL extension, so it might be easier to use Mail_RFC822::parseAddressList() as mentioned in the comments.
mailparse_rfc822_parse_addresses()
Mail_RFC822::parseAddressList()
1.4m articles
1.4m replys
5 comments
57.0k users