29-07-2009

PHP Check email adress with regular expression

There' s a lot of regular expressions out there to match all possible email addresses out there. This is just an unrestrictive and extremely simple example of using PHP's preg_match function to check an email address. It will certainly resolve to true for any existing emailaddress. Perfectly sufficient for most general purposes

if (!preg_match("/.+\@.+\..+/",$email)){
	echo ' email not valid '; 
}

Comments:

Your comment:

»

 

[x]