note 77762 deleted from function.ereg-replace by nlopess
| From: | nlopess@php.net | Date: | Wed, 12 Sep 2007 10:31:12 +0000 |
| Subject: | note 77762 deleted from function.ereg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130412@lists.php.net to get a copy of this message | ||
Note Submitter: alex at macma dot se
----
I found out that none of the examples can handle this kind of email to mailto href:
sirname.lastname@mydomain.com
Well, here is the code to do that.
$txt = ereg_replace('[[:alpha:]]+([.]?[[:alpha:]])+@([.]?[[:alnum:]])*','<a
href="mailto:\\0">\\0</a>',$txt);