rgb192
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);
want only the email address
$from=ray.paseur@gmail.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have a related question,
turning this into a function
https://www.experts-exchange.com/questions/27999141/creating-a-function-from-a-regex-and-returning-two-parts.html
turning this into a function
https://www.experts-exchange.com/questions/27999141/creating-a-function-from-a-regex-and-returning-two-parts.html
ASKER