Извлечение title, meta, body с html файла
Шаблон для извлечение title:
<?php
$html = file_get_contents("http://example.com/");
preg_match('|<title>(.*)</title>|mi', $html, $result);
var_dump($result[1]);
?>
Шаблон для извлечение body:
<?php
$html = file_get_contents("http://example.com/");
preg_match('|<body>(.*)</body>|mi', $html, $result);
var_dump($result[1]);
?>
Шаблон для извлечение meta description:
<?php
$html = file_get_contents("http://example.com/");
preg_match('|<meta\s+name=[\'"]description[\'"]\s+content=[\'"](.*)[\'"]>|mi', $html, $result);
var_dump($result[1]);
?>
Шаблон для извлечение meta keywords:
<?php
$html = file_get_contents("http://example.com/");
preg_match('|<meta\s+name=[\'"]keywords[\'"]\s+content=[\'"](.*)[\'"]>|mi', $html, $result);
var_dump($result[1]);
?>
03.02.2007
