By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

finding all links (like trans-sid)

P: n/a
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?inpage_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

Im guessing preg_replace_callback is going to be used.. something like

$html = preg_replace_callback('/<(a|area|img|link|frame|iframe|input)(.*?)(src|hre f)(\s?=\s?)("|\')?([^>
\'"]+)/is','rewrite_url', $html);

function rewrite_url($html)
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.