valide email php
snippet in php

valide email php

user1046

$email = "email@email.fr";

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  $emailErr = "Email invalide";
}

how to validate an email field using php

user1285

<?php
   $email = "pattrick@tutorialspoint.com";
   // Validate email
   if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
      echo("$email is a valid email address");
   }
   else{
      echo("$email is not a valid email address");
   }
?>