I am using a script to grab headlines and place them on another site. The function works fine with one small problem. The URLs in the original text are relative and I need to convert them to absolute. I have no clue as to how to go about this.
Here is what I have so far:
<?
$fd= fread(fopen("http://www.sportsnetwork.com/default.asp?c=sportsnetwork&page=nascar/indexpic.htm", "r"), 100000);
if ($fd)
{
$start= strpos($fd, "<!-- content include start -->");
$finish= strpos($fd, "<!--<font face=\"arial,helvetica\" size=\"2\">");
$length= $finish-$start;
$code=Substr($fd, $start, $length);
}
echo $code;
?>
I need to get the www.sportsnetwork.com into the relative URLs.
Thanks,
John