Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

want only the email address from $email

$email = " Ray <ray.paseur@gmail.com>"

// A REGULAR EXPRESSION TO FIND THE FROM-EMAIL ADDRESS
$regex
= '#'         //REGEX DELIMITER
. '.*?'       // ANYTHING OR NOTHING
. '\<'        // ESCAPED WICKET
. '(.*?)'     // GROUP OF CHARACTERS WITH EMAIL ADDRESS
. '\>'        // ESCAPED WICKET
. '#'         // REGEX DELIMITER
;


// ISOLATE THE FROM EMAIL ADDRESS
$from = preg_match($regex, $email, $matches);

Open in new window



want only the email address
$from=ray.paseur@gmail.com
ASKER CERTIFIED SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

Thanks