WordPress Snippets at WPcustoms

Check if email is valid

$email = ‘testemail@gmail.com’; // email address which we are verifying if ( is_email( $email ) ) {       echo ‘valid email.’; }else {       echo ‘not a valid email’; }  


/**
 * Snippet Name: Check if email is valid
 * Snippet URL: http://www.wpcustoms.net/snippets/check-if-email-is-valid/
 */
 $email = 'testemail@gmail.com'; // email address which we are verifying
if ( is_email( $email ) ) {
      echo 'valid email.';
}else {
      echo 'not a valid email';
}