Если вы пишете на php, это должно сделать вашу работу
function getdoctitle($link) {
$lines = @file($link);
$str=implode(”\n”,$lines);
$str=preg_match('/<title>([^>]*)<\/title>/si', $str, $matches );
if (strpos(” $str”,”<title>”) and strpos(” $str”,”</title>”)) {
$a1=explode(”<title>”,$str);
$str2=$a1[1];
$a2=explode(”</title>”,$str2);
$str3=$a2[0];
return $str3;
} else {
return “”;
}
}