PhP to get meta data from a website

Comments Off    Share on Facebook
ShortLink:

I have to say this is freakin sweet, especially if you have a links page to capture description data, etc.  Here is the code

<?php
// Assuming the above tags are at www.example.com
$tags = get_meta_tags(‘http://www.putAwebsiteInHere.com/’);

// Notice how the keys are all lowercase now, and
// how . was replaced by _ in the key.
echo ‘author=’.$tags[‘author’].'<br><br>';       // name
echo ‘keywords=’.$tags[‘keywords’].'<br><br>';     // php documentation
echo ‘description=’.$tags[‘description’].'<br><br>';  // a php manual
echo ‘geo_position=’.$tags[‘geo_position’].'<br><br>'; // 49.33;-86.59
?>

Comments are closed.