Skip to content

Instantly share code, notes, and snippets.

@saaiful
Created September 17, 2014 17:59
Show Gist options
  • Save saaiful/9564faddfd561e96884a to your computer and use it in GitHub Desktop.
Save saaiful/9564faddfd561e96884a to your computer and use it in GitHub Desktop.
Gmail Email Filter
<?php
function fraud_gmail($user_email)
{
$user_email = strtolower($user_email);
$data = explode('@', $user_email);
if(count($data)===2)
{
if(preg_match("/g(oogle)?mail(.*)/", $data[1], $ext))
{
$trick = explode('+', $data[0]);
if(count($trick)>0)
{
$data[0] = $trick[0];
}
$user_email = str_replace(array('.','+'), '', $data[0]).'@gmail'.$ext[2];
}
}
return $user_email;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment