Answers for "email validation check php"

PHP
1

php preg_match email validation code

<?php
   function checkemail($str) {
         return (!preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
   }
   if(!checkemail("[email protected]")){
      echo "Invalid email address.";
   }
   else{
      echo "Valid email address.";
   }
?>
Posted by: Guest on May-24-2020
4

check mail php

filter_var($email, FILTER_VALIDATE_EMAIL)
Posted by: Guest on March-07-2020

Browse Popular Code Answers by Language