title: Check if account with such email address already registered (including dots, etc)
body: <p>I read a lot of questions regarding checking if there area identical emails stored in database. However none of those solutions considered a situation when an email provider, for example google, allows users to have dots in their account names. For example <code>username@gmail.com</code> equals <code>user.name@gmail.com</code>.</p>
  
  <p>I understand I can strip dots and check them like this, is it a good idea?</p>
  
  <p>But I believe there are other things that need to be considered here.</p>
  
  <p>Help me check if I already have a given email in database with consideration for dots and other extra factors.</p>
  
  <p><strong>UPDATE</strong>
  This is the way I check if there already is an email address.</p>
  
  <pre><code>public function isemail($email)
  {
      $qw = $this-&gt;registry-&gt;dbi-&gt;prepare("SELECT `email` FROM `".PRE."membership` WHERE `email`=?;")-&gt;execute($email)-&gt;results();
      if (empty($qw)) return false;
      return true;
  }
  </code></pre>
  
  <p>Problem is that for example <code>onetwo@gmail.com</code> is different than <code>one.two@gmail.com</code> because there is a dot. Some emails allow dots to be for same accounts and some do not. How should I behave?</p>
  
  <p><strong>SIMILAR SOLUTION</strong></p>
  
  <p>Solution to a similar question can be found here</p>
  
  <p><a href="https://stackoverflow.com/questions/1586389/how-to-check-for-a-duplicate-email-address-in-php-considering-gmail-user-name">How to check for a duplicate email address in PHP, considering Gmail (user.name+label@gmail.com)</a></p>