i need to rewrite this function to be compatible with php 5.3
function fns_data($address)
{
if (ereg("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $address))
{return true;}
return false;
}
anyone can help?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general, changing ereg to preg is (usually) as simple as renaming it to “preg_match” and adding a
/to the start and end of the pattern. Since your pattern is (relatively) simple: