PHP: convert emails to mailto links
It looks like an easy task, but I decided to share it.
I think that preg_replace function is the best option for doing that. It's just one line of code:
preg_replace('/([a-zA-Z0-9_\\-\\.]*@\\\\S+\\\\.\\\\w+)/', '<a href="mailto:$1">$1</a>', $str);