- fclose: documentation ( source)
- feof: documentation ( source)
- fgets: documentation ( source)
- fopen: documentation ( source)
<?php
$file = fopen ("http://www.tricor.com.br/", "r");
if (!$file) {
echo "<p>Incapaz de abrir arquivo remoto.\n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
/* Isso só funciona se o título e suas tags estiverem na mesma linha */
if (eregi ("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file);
?>