Encode email with PHP then decode with JS

liuk

New Member
I'm working on a website that has many business profiles with their contact information which also include email addresses. Obviously I don't want to output the plain email addresses in the source due to spam. Could do mrsmith[at]gmail.com or obfuscate with ASCII but these solutions aren't ideal, not 100% foolproof.The profiles do have a contact form but I also need to show the email addresses.What I want to do is encode the emails with PHP and then decode with JS and create the anchor link dynamically. So I need an algorithm that's the same in PHP an JS if there is any...
 
Back
Top