MODx - Email Address Encoder To Stop Spam

1. Create a new snippet, title it encodeEmail and add this: <?php $output = ''; for ($i = 0; $i < strlen($email); $i++) { $output .= '&#'.ord($email[$i]).';'; } return $output; 2. Use this code to output accessible and encoded email addresses: [[!encodeEmail?email=`you@example.com.au`]]

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.