Posted By

dubogii on 05/17/11


Tagged

links mailto


Versions (?)

Automatic Mailto Links


 / Published in: PHP
 

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

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

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

Report this snippet  

You need to login to post a comment.