Hey, i am trying to extract links from a page full of links, i have the following code
<?php
$url = "http://80.195.74.35/links.htm";
$contents = Implode("", File($url));
preg_match_all("|href=\"\"?([\"' >]+)|i", $contents, $arrayoflinks);
//Listing the array
While(List(,$link) = Each($arrayoflinks[1]))
echo "$link<Br>";
?>
an example at http://80.195.74.35/spider.php
which is fine if the link currently begins with [url]http://[/url] or www. but if the link is just like "main.htm" then i want it to add the path of the $url variable infront of it, so its changed to
http://80.195.74.35/main.htm
Anyone have any ideas how i could achive this?.
Thanks, Hyabusa