Table of contents Home page
$mtags = get_meta_tags('http://www.majstro.com'); echo 'Description: ', $mtags['description'], "\n";
// Create a temporary HTML file for the purpose of retrieving the meta tags from it $html = <<<EOF <!DOCTYPE HTML> <html> <head> <title>Test</title> <meta name="author" content="Gerard van Wilgen"/> </head> <body> Hello world! </body> </html> EOF; $fileName = 'C:/WINDOWS/Temp/test.html'; $handle = fopen($fileName, 'a'); fwrite($handle, $html); fclose($handle); ini_set('include_path', 'C:/WINDOWS/Temp'); $mtags = get_meta_tags('test.html', TRUE); // The full path isn't passed to the function, but because the second argument has a true value, the function will use // the value of include_path to locate the file. echo 'Description: ', $mtags['author'], "\n"; unlink($fileName);