How can I validate the input value is a valid email address using php5. Now I am using this code
function isValidEmail($email){
$pattern = \"^[_a-z0-9
User data is very important for a good developer, so don't ask again and again for same data, use some logic to correct some basic error in data.
Before validation of Email: First you have to remove all illegal characters from email.
//This will Remove all illegal characters from email
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
after that validate your email address using this filter_var()
function.
filter_var($email, FILTER_VALIDATE_EMAIL)) // To Validate the email
For e.g.