Skip to main content
Inspiring
March 10, 2008
Question

Hyperlinking a block of text

  • March 10, 2008
  • 2 replies
  • 472 views
I have a block of text that I retrieve from the sql dbase. I then need to display this on the site. However, what I need to do is search for any hyperlinks, which could be defined by strings that start with HTTP:// and then replace them with <A href="THELINK">THELINK</a>, so that the links all hyperlink when displayed.

There will be multiple links in one block of text.

Does anybody have any code that code take care of this? I guess replacenocase will come into place somehow

Thanks

Mark
This topic has been closed for replies.

2 replies

Inspiring
March 10, 2008
Actually, I was asking about the starting point for the closing anchor tag.
ACS LLCAuthor
Inspiring
March 10, 2008
That would still be the space?
Inspiring
March 10, 2008
What will the links end with?
ACS LLCAuthor
Inspiring
March 10, 2008
that is an unknown as our usres type in their own text and URL's. However the proceeding character has to be a space

So it would being with HTTP:// and the decided character at the end would be a space.

Example
I think you should go to http://www.google.com to search for the information

By locating the http:// and the space after the .com it could be hyperlinked.