Hi all,
I'm currently in the process of creating a HTML extractor and have come to a hurdle. To begin with i'm trying to extract the <TITLE> from the http://www.thebikebarn.co.uk/links.shtml page. This is what i have so far:
$filename = "http://www.thebikebarn.co.uk/links.shtml";
$handle = fopen ($filename, "r");
if($handle) {
while(!feof($handle)) {
$contents = $contents . fread($handle, 1024);
}
}
$doctype_pos = strpos($contents,"<!DOCTYPE");
$endhtml_pos = strpos($contents,"</TITLE>");
$contents = substr($contents,$doctype_pos,(($endhtml_pos+8)-$doctype_pos));
echo "$contents";
This is not returning anything. Any ideas on how to fix this?
Cheers,
micmac