We can use Regular Expressions to get the title of a page, see the PHP code snippet below which extracts the title of page who's URL you specify.

Code: PHP
$url = "http://www.go4expert.com/showthread.php?t=2";
$file = file($url);
$file = implode("",$file);

if(preg_match("/<title>(.+)<\/title>/i",$file,$m))
    print "The title of $url is <b>$m[1]";
else
    print "The page doesn't have a title tag";