I need the content the description and the keywords tag content. I have this code, but dont write anything. Idea?
$str = <<< EOD
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="description" content="text in the description tag" />
<meta name="keywords" content="text, in, the, keywords, tag" />
</head>
EOD;
$dom = new DOMDocument();
$dom->loadHTML($str);
$xpath = new DOMXPath($dom);
$nodes = $xpath->query('/html/head/meta[name="description"]');
foreach($nodes as $node){
print $node->nodeValue;
}