note 27106 added to function.preg-replace
| From: | pedram at redhive dot com | Date: | Fri, 22 Nov 2002 22:00:32 +0000 |
| Subject: | note 27106 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39880@lists.php.net to get a copy of this message | ||
perhaps i'm missing something here, but one thing that i am certain of is that the regex's
listed on this page are all missing the full URL's.
for example:
- http://www.example.com/~meow/file.html
- http://www.example.com/?var=val
in both the above cases the URL is chopped after ".com/"
the simple regex i use to generate hyperlinks out of flat text is:
$text = preg_replace("/(http.*:\/\/.+)\s/U", "<a
href=\"$1\">$1</a>", $text);
-pedram
http://pedram.redhive.com
--
http://www.php.net/manual/en/function.preg-replace.php
http://master.php.net/manage/user-notes.php?action=edit+27106
http://master.php.net/manage/user-notes.php?action=delete+27106
http://master.php.net/manage/user-notes.php?action=reject+27106