title: DomDocument_object->getElementsByTagName('a'); returning an empty array when there are anchors on the page
body: <p>I am using PHP's DomDocument class to parse HTML.</p>
  
  <p>When I give it html that has anchors it it and ask it to find all the anchors and store them in an array, it gives me an empty array as if there are no anchors.</p>
  
  <p>Why is it doing this and how can I fix it?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$dom = new DOMDocument();
  $domObject-&gt;loadHTML($content);
  $anchors = $domObject-&gt;getElementsByTagName('a');
  print_r($anchors); // returns empty array.
  </code></pre>
  
  <p>and $content looks like this:</p>
  
  <pre><code>     &lt;p&gt;
          Friend David, I do not think we shall need a call bell as Hello! can be heard 10 to 20 feet away. What you think? Edison - P.S. first cost of sender &amp; receiver to manufacture is only $7.00.[12] Hello, hello! New York, hello!
         &lt;/p&gt;
         &lt;a href="http://the-irf.com/hello/hello5.html"&gt;Prev&lt;/a&gt;
         &lt;a href="hello7.html"&gt;Next&lt;/a&gt;
         &lt;a href="end.html"&gt;End&lt;/a&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>