Have an account? Sign in
Login  Register  Facebook
This Page is Under Construction! - If You Want To Help Please Send your CV - Advanced Web Core (BETA)
[Edit] PHP Simple Anti-Email-Harvesting

PHP Simple Anti-Email-Harvesting

function no_harvest($email = null) {
   if($email == null)
      // function did not get the required argument
      return false;
   else {
      // assign possible replacements
      $ats  = array("[at]", " [at] ", " [ at ] ", "[ at ]", "[@]", "[ @ ]", " @ ", " at ");
      $dots = array("[dot]", " [dot] ", " [ dot ] ", "[dot]", "[.]", "[ . ]", " . ", " dot ");
      // decide which randoms to use
      $atr  = $ats[rand(0, count($ats)-1)];
      $dotr = $dots[rand(0, count($dots)-1)];
      // fix and return email
      return str_replace(array("@", "."), array($atr, $dotr), $email);
   }
}