Forum Moderators: coopster
Example of what works:
test@test.org
me@this.org
you@domain.org
Example of what is invalid
test@test.com
me@this.net
you@domain.info
$errors=0;
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$FriendEmail)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
The rest of script goes here
}
Why not use substr() [php.net] if all you want to check is the last 4 characters?
if (substr($email, -4) == '.org') {
// good
} else {
// bad
}