I have been trying to pout together a simple function to check the email field has been used and it is valid.
I found a longer function which I simplified to this, does this need improving?
function c4emailchk($email) {
if (preg_match('/^\w[-.\w]*@(\w[-._\w]*\.[a-zA-Z]{2,}.*)$/', $email, $matches)) {
return true;
}
return false;
}
Thanks!