Here is the code that i am trying to implement

$selector = xpath select for comments

```
    $dom = new DOMDocument;
$dom->loadHTML($html);
$dom->preserveWhiteSpace = false;
$xpath = new DOMXPath($dom); 
foreach ($xpath->query($selector) as $aNode) 
{ 
echo ($aNode->nodeValue);
} 

```