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)
{
}
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)
{
}