Return to Snippet

Revision: 46336
at May 17, 2011 19:51 by dubogii


Initial Code
$string = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})','<a href="mailto:\\1">\\1</a>', $text);
echo $string;

Initial URL
http://css-tricks.com/snippets/php/automatic-mailto-links/

Initial Description
the POSIX Regex functions are deprecated in PHP 5.3.0 and removed in PHP 6.
http://us2.php.net/manual/en/function.eregi-replace.php

Initial Title
Automatic Mailto Links

Initial Tags
links

Initial Language
PHP