note 35221 added to function.eregi-replace

From: Date: Sun, 24 Aug 2003 02:03:23 +0000
Subject: note 35221 added to function.eregi-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-54979@lists.php.net to get a copy of this message
To obtain the an email addresse in the scheme user at host dot use following function function antispam_mail($mail) { return eregi_replace( "^([_\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\.([a-z]{2,6})$", '\\1 at \\2 dot \\3',$mail ); }; Combined with a wee JavaScript (document.location='mailto:'+user+'@'+host+'.'+tld) this provides a very powerfull anti-spam mechanism while providing full mailto: link functionality. ---- Manual Page -- http://www.php.net/manual/en/function.eregi-replace.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35221 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35221&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35221&report=yes

« previous php.notes (#54979) next »