<?php $email = 'delboy1978uk@work.com'; $regex = '#\w+@(?<domain>\w+\-?\w+\.\w+)#'; preg_match($regex, $email, $matches); $domain = $matches['domain']; if ($domain !== 'example-test.com') { echo 'domain '.$domain.' doesnt match'; }
You have javascript disabled. You will not be able to edit any code.