
16-May-2003, 12:23
|
 |
Regular Member
|
|
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
|
|
|
E-mail address cloaker
Found this and its under the GPL so here you go.
PHP Code:
<?php
/*
* email_address_cloaker.php
*
* Author: Steve Werby <steve at(@) befriend dot(.) com>
* Created: 2000-11-24
* Revised: 2001-02-16
*
* Purpose: Cloaks an email address to reduce harvesting by spambots.
*
* Latest version always available at http://www.befriend.com/
*********************************************************************/
// Obfuscates an email address to reduce harvesting by spambots
// by cloaking the email address by replacing dots and at signs
// with HTML entitities, words and spaces in order to generate
// a human-comprehendable email address.
//
// There are a practically unlimited number of variations possible
// so feel free to edit to suit your needs and make spammers' jobs
// that much more difficult!
//
// As written if a style isn't supplied as a parameter then the
// first case is used and if an invalid style is specified the
// second case is used.
function email_address_cloaker( $email, $style = 1 )
{
switch( $style )
{
case 1:
$cloaked = str_replace( "@", " at ", $email );
$cloaked = str_replace( ".", " dot ", $cloaked );
break;
case 2:
default:
$cloaked = str_replace( "@", " at(@) ", $email );
$cloaked = str_replace( ".", " dot(.) ", $cloaked );
break;
}
return $cloaked;
}
/*
* Usage of email_address_cloaker().
*********************************************************************/
echo email_address_cloaker( 'user@somewhere.com', 2 );
?>
|
|