Hello,

I have an email string that sometimes has a name and the email address between <> and sometimes has the email adress right away.

Two examples of the possible value of $address

Joe Doe <[EMAIL PROTECTED]> [EMAIL PROTECTED]

I need to convert this string always to the email address and discard the name to the left of the < character, if the string is already correct (like [EMAIL PROTECTED]) then do not change it, keep it as it is.

I have writen a function to do a for loop and check for the < then copy everything to the end removing the >. I wonder, is there a more efficient, clear way to accomplish this?

Thanks in advace.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to