We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    PHx modifier to auto parse links in Jot comments (or any other text).

    I know nothing about regex so please test this out and see if any issues come up (the original code is from a comment on the php site).

    <?php
    /*
     * phx:parseLinks
     */
    $t = $output;
    $t = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "<a href=\"\\0\">\\0</a>", $t);
    $t = ereg_replace("(^| |\n)(www([.]?[a-zA-Z0-9_/-])*)", "\\1<a href=\"http://\\2\">\\2</a>", $t);
    return $t;
    ?>
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don&#39;t know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 6726
      • 7,075 Posts
      Very cool, thanks for this one grin
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id