finding all links (like trans-sid)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • will

    finding all links (like trans-sid)

    Im trying to replicate the action of enable-trans-sid with a script.
    e. g throw a function a html page/string and it will replace all links
    - relative or absolute - with a variable at the end. either
    link.html?var=$ var or link.html?inpag e_var=something &var=$var
    depending on whether the link had a querystring on it already.

    any ideas? anything already done? dont really want to reinvent the
    wheel.

    Im guessing preg_replace_ca llback is going to be used.. something like

    $html = preg_replace_ca llback('/<(a|area|img|li nk|frame|iframe |input)(.*?)(sr c|href)(\s?=\s? )("|\')?([^>
    \'"]+)/is','rewrite_ur l', $html);

    function rewrite_url($ht ml)
    {
    }
Working...