To manupulate with HTML you can use Document Object Model (this is the recomended way).
If you are looking for a dirty fast solution, it's rather simple regexp:
$html = file_get_contents('http://example.com');
$matches = preg_match("/<title>([^<]*)<\/title>/im");
echo $matches[1];