Return to Snippet

Revision: 24088
at February 20, 2010 16:46 by khaled


Initial Code
<?php
function hide_from_spam($Email='spam[email protected]'){
	$Email = str_replace('@', '&#64;', $Email);
	$Email = str_replace('.', '&#46;', $Email);
	$Email = str_split($Email, 4);

	// Print email using JavaScript
	$anti_spam = '<script type="text/javascript">';
	foreach($Email as $write_email){
		$anti_spam .= "document.write('$write_email');";
	}
	$anti_spam .= '</script>';

	return $anti_spam;
}

echo hide_from_spam('[email protected]');

?>

Initial URL


Initial Description


Initial Title
Hide Email From Spammer by php and Javascript (Under Testing)

Initial Tags
email, javascript

Initial Language
PHP