Sometimes, while filling forms on your website, a user can mistype his email address. Using the below function you can check if the email provided by user is in correct format.
$check = 0;
$check = 1;
$email = “email@example.com”;
$check = is_validemail($email);
// If the output is 1, then email is valid.