clickable url's & emails

    Date: 05/10/05 (PHP Development)    Keywords: no keywords

    I need to make url's & email addresses clickable but to not mess with already formatted links & emails.

    I am using this now but it messes up already formatted links:

    $Text=ereg_replace ('[_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]+)*\@'
    .'[_a-zA-Z0-9\-]+(\.[a-zA-Z]{1,3})', 'href="mailto:\\0">\\0',$Text);

    $Text =
    ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","href=\"\\0\" target=\"_blank\">\\0",
    $Text);

    Anybody know how to do this?

    Source: http://www.livejournal.com/community/php_dev/57372.html

« PHP Syntax Exam || clickable url's & emails »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home