I need the content the description and the keywords tag content. I have this code, but dont write anything. Idea?
$str = <<< EOD
You have two problems. First, name is an attribute so you need to prepend @,
$nodes = $xpath->query('/html/head/meta[@name="description"]');
Second, the nodes are all empty so there is nothing to print.
To print the attribute value, do this,
foreach($nodes as $node){
$attr = $node->getAttribute('content');
print $attr;
}