I have this code in my PHP form :
function IsEmail($email)
{
$pattern = "^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,7}$";
return (eregi($pattern,$email)) ? true : false;
};
And my local server gives me an error :
Function eregi() is deprecated
So I modified my code to :
function IsEmail($email)
{
$pattern = "^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,7}$";
return (preg_match($pattern,$email)) ? true : false;
};
and now I get this error :
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found
Any idea ?