PHP and Javascript Email Validation of '@' Symbol

后端 未结 4 873
暗喜
暗喜 2021-01-25 01:21

Trying to get code to search if \'@\' symbol is present in typed-in email address and echo if symbol is not. Everything works fine without the searching for @ code.

chec

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-25 01:53

    you can use default php email validation

    if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
      echo("$email is a valid email address");
    } else {
      echo("$email is not a valid email address");
    }
    ?>
    

    you can also check this at https://eval.in/870776

提交回复
热议问题