Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Registration Email Validation Re: WordPress Registration Email Validation

#72584
ddliu
Member

Hi jlau, I guess you are meaning “how to validate such an email address”.

Basically you may have a regular expression to do this in PHP, and maybe following code will work for you:


if(preg_match('#^[a-z0-9_.-]{1,50}@([a-z0-9_-].){0,5}ac.uk$#i',$email)){
echo "Yeah, you have an ac.uk email address!";
}
else{
echo "Oops, your email address is not valid or is not an ac.uk email address!";
}