title: Error with FILTER_VALIDATE_EMAIL
body: <p>For some reasons, that are unclear for me, I can't use this code on my website: when I use it the <code>php</code> form doesn't load.     </p>
  
  <pre><code>&lt;?php
  $email = "john.doe@example.com";
  $email = (filter_var($email, FILTER_SANITIZE_EMAIL));       
  if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
      echo("$email is a valid email address");
  } else {
      echo("$email is not a valid email address");
  }
  </code></pre>
  
  <p>This one works but it doesn't give an error when there isn't a <code>.</code> after the <code>@</code> in the email, so the email below get validated</p>
  
  <pre><code>$email = "john.doe@examplecom";
  $email = (filter_var($email, FILTER_SANITIZE_EMAIL));
  
  if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
      echo("$email is a valid email address");
  } else {
      echo("$email is not a valid email address");
  }
  ?&gt;
  </code></pre>
  
  <p>How can I get my form to validate only email with an <code>@</code> and a <code>.</code> after the <code>@</code> </p>
  
  <p>Edit:</p>
  
  <pre><code>        $authorEmail = (filter_var($_POST['formEmail'], FILTER_SANITIZE_EMAIL));
          if (!(filter_var($authorEmail, FILTER_VALIDATE_EMAIL))){
              $emailError = true;
              $hasError = true;
          } else{
              $formEmail = $authorEmail;
          };
  </code></pre>