Automatic Mailto Links

Submitted by:Jhon Smith

Date added:12 March, 2017

Category:PHP

PHP code snippet for Automatic Mailto Links

Tags: mailto

Code Snippet:

$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;
 
 

Comments