note 13744 deleted from ref.strings by sander
| From: | sander@php.net | Date: | Sun, 07 Apr 2002 13:40:13 +0000 |
| Subject: | note 13744 deleted from ref.strings by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28923@lists.php.net to get a copy of this message | ||
Here are 2 rather handy regular expressions I use for automatical in-lining text to HTML (AKA
url_clickable):
For mailto links:
eregi_replace("([
]+)([[:alnum:]\.\-]+\@[[:alnum:]\-]+\.[\.[:alnum:]]+)([^\.[:alnum:]])","\\1<a
href=\"mailto:\\2\">\\2</A>\\3", $string;
for urls:
eregi_replace("(![\"])((http|https|ftp)\:\/\/[[:alnum:]\-]+\.[[:alnum:]\-]+[^[:space:]]*.)","<a
target=_new href=\"\\1\">\\1</a>", $string);