Espero no haber "reinventado la rueda" y q no haya uan forma mucho más fácil de hacerlo...
Código PHP:
$fp = fopen($pri,"r");
if (!$fp) {
die("Salto un error $errno");
} else {
while(!feof($fp)) {
$pag = fread($fp,1024);
$a = strstr($pag,'<title>');
$letras = strlen(strstr($a,'</title>')) + 7;
echo htmlentities(substr($a,7,strlen($a)-$letras));
}
}
fclose ($fp);