note 24517 deleted from function.preg-replace by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 22:05:35 +0000 |
| Subject: | note 24517 deleted from function.preg-replace by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55701@lists.php.net to get a copy of this message | ||
Note Submitter: sylvinus@lynucs.com
----
Here's an improved url detection preg :
$text = preg_replace("/(?:^|\b)((((http|https|ftp):\/\/)|(www\.))
([\w\.]+)([,:%#&\/?=\w+\.-]+))(?:\b|$)/is", "<a href=\"$1\"
target=\"_blank\">$1</a>", $text);
Hope it'll help :-)
Sylvinus