Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    1

    Unanswered: How to automatically parse links in my DB text

    Hi,

    I am setting up a basic content mgmt system for a client. My client will be copying and pasting long articles into a database field and the text often includes a URL somewhere in the article. Is there a way to parse the URL link (in other words, create a hyperlink from the URL text) without using a rich text editor? Javascript or PHP or something?


    By the way, does anyone know what RTE this forum uses? It seems to work well in all browsers.

    Thanks!

    Natalie

  2. #2
    Join Date
    Jul 2004
    Location
    Dundee, Scotland
    Posts
    107
    Using PHP....
    $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
    "<a href=\"\\0\">\\0</a>", $text);

    see:
    http://aspn.activestate.com/ASPN/doc...g-replace.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •