Parse a string containing name and email
| From: | Don | Date: | Sun, 07 Mar 2010 02:34:22 +0000 |
| Subject: | Parse a string containing name and email | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-302586@lists.php.net to get a copy of this message | ||
Hi,
I am pulling email values out of a database and the format is as follows:
John Smith<john.smith@somedomain.com>
I need to parse the string into two variables as such
$name = John Smith
$email = john.smith@somedomain.com
What would be the easiest way to do this?
Thanks.