Possible Duplicate:
Finding and Printing all Links within a DIV
I'm trying to make a mini crawler..when i specify a site.. it does file_get_contents()..then get the data i want.. which i've already done.. now i want to add code that enables it to find..any external links on the site it is on.. and get the data ..
basically..instead of me specifying a site..it just follows external links and get the data if available...
here is what i have..
thanks in advance..
<?php
$link = strip_tags($_GET['s']);
$path_info = parse_url($link);
$name= $path_info['host'];
$name= str_replace('www.','', $name);
$original_file = @file_get_contents($link);
if($original_file === false) {
die("$link does not exist");
}
$data= preg_match("stuff", $original_file, $m);
echo $data;