title: cURL php get url of all images
body: <p>I get this error by using the following code any suggestion why this error occur and how to solve..</p>
  
  <blockquote>
    <p>Notice: DOMDocument::loadHTML(): Namespace prefix g is not defined in
    Entity, line: 74 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): Tag g:plusone invalid in Entity,
    line: 74 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in
    Entity, line: 82 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in
    Entity, line: 82 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): End tag : expected '>' in Entity,
    line: 104 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): Unexpected end tag : g in Entity,
    line: 104 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): Unexpected end tag : head in Entity,
    line: 149 in C:\xampp\htdocs\curl\img.php on line 43</p>
    
    <p>Warning: DOMDocument::loadHTML(): htmlParseStartTag: misplaced 
    tag in Entity, line: 150 in C:\xampp\htdocs\curl\img.php on line 43</p>
  </blockquote>
  
  <p><strong>My code so far:</strong></p>
  
  <pre><code>$html = file_get_contents($url);
                  $dom = new domDocument;
                  $dom-&gt;loadHTML('&lt;?xml encoding="UTF-8"&gt;'.$html);
                  $images = $dom-&gt;getElementsByTagName('img');
                  foreach($images as $image){
                      $img = $image-&gt;getAttribute('src');
                      echo $img."&lt;/br&gt;";
                  }
  </code></pre>