title: PHP DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity
body: <p>I trying to get the "link" elements from certain webpages. I can't figure out what i'm doing wrong though. I'm getting the following error:</p>
  
  <blockquote>
    <p>Severity: Warning</p>
    
    <p>Message: DOMDocument::loadHTML() [domdocument.loadhtml]:
    htmlParseEntityRef: no name in Entity, line: 536</p>
    
    <p>Filename: controllers/test.php</p>
    
    <p>Line Number: 34</p>
  </blockquote>
  
  <p>Line 34 is the following in the code:</p>
  
  <blockquote>
  <pre><code>      $dom-&gt;loadHTML($html);
  </code></pre>
  </blockquote>
  
  <p>my code:</p>
  
  <pre><code>            $url = "http://www.amazon.com/";
  
      $ch = curl_init();
  
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
      if($html = curl_exec($ch)){
  
          // parse the html into a DOMDocument
          $dom = new DOMDocument();
  
          $dom-&gt;recover = true;
          $dom-&gt;strictErrorChecking = false;
  
          $dom-&gt;loadHTML($html);
  
          $hrefs = $dom-&gt;getElementsByTagName('a');
  
          echo "&lt;pre&gt;";
          print_r($hrefs);
          echo "&lt;/pre&gt;";
  
          curl_close($ch);
  
  
      }else{
          echo "The website could not be reached.";
      }
  </code></pre>