title: Selecting a css class with xpath
body: <p>I want to select just a class on its own called .date</p>
  
  <p>For some reason, I cannot get this to work. If anyone knows what is wrong with my code, it would be much appreciated.</p>
  
  <pre><code>@$doc = new DOMDocument();
  @$doc-&gt;loadHTML($html);
  $xml = simplexml_import_dom($doc); // just to make xpath more simple
  $images = $xml-&gt;xpath('//[@class="date"]');                             
  foreach ($images as $img)
  {
      echo  $img." ";
  }
  </code></pre>