PHP Snippets
Name:Email Spam Protection
Description: This will protect you from spam when displaying your email address on your website.
Code below...
>
<?php
//Your Email
$email = "myemail@address.com";
//Replace "@" with "[at]"
$email = str_replace('@','[at]',$email);
//Replace "." with "[dot]"
$email = str_replace('.','[dot]',$email);
//Display the result: myemail[at]address[dot]com
echo $email;
?>
//Your Email
$email = "myemail@address.com";
//Replace "@" with "[at]"
$email = str_replace('@','[at]',$email);
//Replace "." with "[dot]"
$email = str_replace('.','[dot]',$email);
//Display the result: myemail[at]address[dot]com
echo $email;
?>