Jump to content

Email format validation


achintha

Recommended Posts

Hi, I need simple function to validate email address format.

 

I have found follwoing function form google.

 

function isemail($email){
return (bool)ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
}

 

It's working fine with php < 5.2. But when I'm using with PHP 5.3

is says

Deprecated: Function ereg() is deprecated in C:\wamp\www\*******\includes\functions.php on line 28

 

Is any solution to this without error disable?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/210961-email-format-validation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.