Page 1 of 1

Meta tag grabber

Posted: Fri Nov 10, 2006 6:42 am
by virtualone
well i am trying to get meta tags from a given URL.. i came up with this code ..
<?php
$URL = 'http://www.yahoo.com';

$meta_tags = get_meta_tags($URL) or die("Could not fetch meta tags for $URL");

print_r($meta_tags);
?>

but this code always fails .. why ? any better idea?

Posted: Fri Nov 10, 2006 7:05 am
by volka
try

Code: Select all

<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
echo 'allow_url_fopen: ', ini_get('allow_url_fopen') ? 'on':'off', "<br />\n";

$URL = 'http://www.yahoo.com';
$meta_tags = get_meta_tags($URL) or die("Could not fetch meta tags for $URL");
print_r($meta_tags);
?>
and post the output, esp. error/warning messages.