• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hyperlinking a block of text

Enthusiast ,
Mar 10, 2008 Mar 10, 2008

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

353

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 10, 2008 Mar 10, 2008

Copy link to clipboard

Copied

What will the links end with?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 10, 2008 Mar 10, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 10, 2008 Mar 10, 2008

Copy link to clipboard

Copied

Actually, I was asking about the starting point for the closing anchor tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 10, 2008 Mar 10, 2008

Copy link to clipboard

Copied

LATEST
That would still be the space?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation