How can I check for duplicate email addresses in PHP, with the possibility of Gmail\'s automated labeler and punctuation in mind?
For example, I wan
I have extended Zend Validator like this.
<?php
class My_Validate_EmailAddress extends Zend_Validate_EmailAddress
{
public function isValid($value)
{
$valid = parent::isValid($value);
if ($valid
&& in_array($this->_hostname, array('gmail.com', 'googlemail.com'))
&& substr_count($this->_localPart, '.') > 1) {
$this->_error(parent::INVALID_HOSTNAME);
$valid = false;
}
return valid;
}
}
Email with more than one "dot" symbol in gmail address are considered invalid. For some cases this is not logical solution, but that works for me.