Given a list of emails, formated:
"FirstName Last" <[email protected]>, "NewFirst NewLast" <[email protected]>
How can I build this into a string array of Only email addresses (I don't need the names).
Given a list of emails, formated:
How can I build this into a string array of Only email addresses (I don't need the names).
|
|||||||
|
PHP’s Mailparse extension has a |
|||||||||
|
You could use
Provided that all addresses are enclosed in EDIT In response to comments, the regex could be rewritten as EDIT #2 Use a parser for any non-trivial data (see the comments below - email address parsing is a bitch). Some errors could, however, be prevented by removing duplicate addresses. |
|||||||||||||
|
|
|||||
|