Take this email for example
$email = "outlook_75AA07B2DF4B8074@outlook.com";
I need to use php to find out if an email starts with outlook_
AND ends with @outlook.com
. Since 75AA07B2DF4B8074
will always be different. I've got the beginning but not sure how to get the end as well.
if (strpos($email, 'outlook_') === 0) {
}
preg_match('/^outlook_.*@outlook\.com$/', $email);