For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, March 12, 2015

Validate email in PHP

Here is the simple php function by this you can validate email which entered by any user.

public function checkEmail($mailID) {
$pat = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-.]+\.[a-zA-Z. ]{2,6}$/";
if(preg_match($pat,$mailID)) {
return true;
} else {
return false;
}
}
Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive