Hi !
Which command to include so I can see on the screen the result of this ?
thanks !!!!
Patrick
[code=php]<?php
$page_title = “n/a”;
$meta_descr = “n/a”;
$meta_keywd = “n/a”;
if ($handle = @fopen(“http://www.finalwebsites.com”, “r”)) {
$content = “”;
while (!feof($handle)) {
$part = fread($handle, 1024);
$content .= $part;
if (eregi(“</head>”, $part)) break;
}
fclose($handle);
$lines = preg_split(“/r?n|r/”, $content); // turn the content in rows
$is_title = false;
$is_descr = false;
$is_keywd = false;
$close_tag = ($xhtml) ? ” />” : “>”; // new in ver. 1.01
foreach ($lines as $val) {
if (eregi(“<title>(.*)</title>”, $val, $title)) {
$page_title = $title[1];
$is_title = true;
}
if (eregi(“<meta name=”description” content=”(.*)”([[:space:]]?/)?>”, $val, $descr)) {
$meta_descr = $descr[1];
$is_descr = true;
}
if (eregi(“<meta name=”keywords” content=”(.*)”([[:space:]]?/)?>”, $val, $keywd)) {
$meta_keywd = $keywd[1];
$is_keywd = true;
}
if ($is_title && $is_descr && $is_keywd) break;
}
}
?>