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()
2.1m questions
2.1m answers
60 comments
57.0k users