How can validate a email id using php.


<?php
$email = "exmaple@gmail.com";
    if (filter_var($email , FILTER_VALIDATE_EMAIL)) {
        echo 'Valid Email id ';exit;
    }
    else {
        echo 'Invalid Email id ';exit;
    }
?>
Output = Valid Email id .