HTML Entitize any string
12
This function is useful in helping to deter spam bots by obfuscating things such as e-mail addresses and URLs that are displayed on a web page. While it's not 100% fool proof, it does offer some protection.
Example:
$email = html_entitize('foo@baz.org');
/*
Outputs foo@baz.com
*/
Example:
$email = html_entitize('foo@baz.org');
/*
Outputs foo@baz.com
*/






When it comes down to it, the only protection against spambots is to not list an email online. Bots know all about entities and hex escapes. Heck, most of them use libcURL, so such techniques are transparent to them (i.e. they don't even see the entities or hex escapes).
Sorry to be the bearer of bad tidings . . .
I've got good news, and I've got bad news:
The universe is merely a figment of my imagination.
Now are you ready for the bad news?