Admin Admin
Сообщения : 74 Очки : 71 Дата регистрации : 2010-08-23
| Тема: Получение заголовка удаленной страницы Пт Сен 10, 2010 3:44 am | |
| Данный скрипт показывает как легко и просто получить заголовок удаленной страницы - Код:
-
<?php
$file = fopen ("http://www.php.net/", "r");
if (!$file) {
echo "<p>unable to open remote file.n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
/* this only works if the title and its tags are on one line */
if (eregi ("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file);
?> | |
|