0

Anyone know how you grab data from a HTML meta tag with PHP?

live example

I want it to render the meta title and not the file title. Look at the orange text.

Kara
  • 6,115
  • 16
  • 50
  • 57
Kurt Bertil
  • 5
  • 1
  • 6
  • 1
    Stack Overflow should not be your first stop when researching something unless you're here to actually use the search functionality. – John Conde Nov 15 '13 at 21:54
  • nah there is no similarity with it. this is a straightforward question with a straightforward answer – DWolf Nov 15 '13 at 21:54

1 Answers1

4
$tags = get_meta_tags('http://www.example.com/');

echo $tags['author'];       // name
echo $tags['keywords'];     // php documentation
echo $tags['description'];  // a php manual
echo $tags['geo_position']; // 49.33;-86.59

this will only return meta tags that have named values though

http://php.net/manual/en/function.get-meta-tags.php

go here for examples of usage

DWolf
  • 703
  • 1
  • 7
  • 20