help with preg_replace for http://
| From: | Kevin Won | Date: | Fri, 29 Mar 2002 19:46:24 +0000 |
| Subject: | help with preg_replace for http:// | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18043@lists.php.net to get a copy of this message | ||
I'm writing a knowledgebase (basically a content management system) application where people
are adding text via web forms then viewing this data on the web. standard bread-and-butter kind of
stuff.
of course people want to put in their hyperlinks in the page w/o having to do any sort of html
coding. I'm having a hard time getting my regular expression to work correctly to match for
anything that starts with http:// and ends with a space character, extracting
this as a $string, then formatting the hyperlink as <a
href="$string">$string</a> on the knowledgebase viewing scripts.
The one I've written matches and replaces only the first instance of http:// in the string. (which solves problems as long as there is only one
hyperlink in the page ;-)
thanks
kevin
Kevin Won
-------------------------------------------------------------
ITG Web Developer,
Systems Administrator
Oregon Health Sciences University
(503) 418-4282
cell: (503) 913-5367
page: x15897
fax: (503) 494-1888