title: scraping all images from a website using DOMDocument
body: <p>I basically want to get <strong>ALL</strong> the images in any website using DOMDocument.
  but then i cant even load my html due to some reasons I dont know yet.</p>
  
  <pre><code>$url="http://&lt;any_url_here&gt;/";
  $dom = new DOMDocument();
  @$dom-&gt;loadHTML($url); //i have also tried removing @
  $dom-&gt;preserveWhiteSpace = false;
  $dom-&gt;saveHTML();
  $images = $dom-&gt;getElementsByTagName('img');
  foreach ($images as $image) 
  {
  echo $image-&gt;getAttribute('src');
  }
  </code></pre>
  
  <p>what happens is nothing gets printed . or did I do something wrong with the code?</p>