I had to write a site analyzer for my company and I noticed that the built in PHP func. wouldn't always work for what reason, I don't know, but I used a regular expression as you can view below to work flawlessly everytime...
<?php
$fp = fopen("http://www.domain.com/", "r");
$result = fread($fp,55000);
fclose($fp);
if (eregi("<title>(.*)</title>", $result, $titlefind)){
$xk = trim(ereg_replace("[[:space:]]+", " " , $titlefind[1]));
// I cant remember why I did the next if statement!
if(eregi("</", $xk)){
$yk = substr ($xk, 0, strpos($xk, "</"));
}else{
$yk = "$xk";
}
$title = strip_tags($yk);
}else{
$title = "missing!";
}
echo("The title is <B>$title</b><BR>");
?>
If you are using php 4.06, make sure there is a trailing slash on the url. This was a bit more work, but it was the only solution I came up with. I used the same method for extracting all the data substituting <meta & > in place of the beginning and ending title tags & you will need to strip out new line characters "\n" to make it work correctly for all the additional meta tags.
I hope this helps!
Ron