Hi all, I need to parse an HTML file for all instances of href and img calls, turning local refrences to fully qualified ones ie <a href='test.html'> becomes <a href='http://www.myserver.com/mydir/test.html'>.
BUT if I find a URL which is already fully qualified (if it contains the string http I assume that's the case) I want to leave it alone.
I already have this code which modifies all href/img calls but I can't seem to sort out the bit which ignores the string if it contains http...
$content = preg_replace("~(href|src)='([\"'?])'~","\1='http://www.server.com/mydir/\2'",$content)("~(href|src)='([\"'?])'~","\1='http://www.server.com/mydir/\2'",$content);
Any help gratefully accepted,
Regards
Chris