How to check whether an email is valid or not in php ?

Using filter_var function , we can check whether an email is valid or not valid with FILTER_VALIDATE_EMAIL filter.

if(filter_var(“[email protected]”,FILTER_VALIDATE_EMAIL))
{

echo “valid”;

} else echo “not valid”;

Posted in Php