Replace Email

Posted on Monday, August 10, 2009 in PHP

$pattern='|(\S+)\@(.*)\.(\S+)|is';
$msg=preg_replace($pattern, '< a href="mailto:$1@$2.$3">$1@$2.$3< /a >', $msg);

Leave a Comment

You must be logged in to post a comment.