Php - Validate E-Mail

PHP - Validate E-mail
The easiest and safest way to check whether an email address is well-formed is to use PHP's filter_var() function. In the code below, if the e-mail address is not well-formed, then store an error message:

When Return ture this email format is valid. filter_var($email, FILTER_VALIDATE_EMAIL)

Can Check alternative idea

$email = 'sazzad@nextzen.com.bd';
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  $emailErr = "Invalid email format";
}

Write a Associte Comment
Markdown Editor