title: How to download images from a single webpage using PHP
body: <p>I created this script to get the sources of the images from a single webpage, now, i wanted to download all those images to my server using curl. </p>
  
  <pre><code>&lt;?php 
  // Create DOM from URL or file
  require_once 'library/simple_html_dom.php';
  $html = file_get_html('http://adamkhoury.com/');
  
  // Find all images 
  foreach($html-&gt;find('img') as $element) //every image found is declared as $element
         echo $element-&gt;src . '&lt;br&gt;';
  
  ?&gt;
  </code></pre>