title: Copy a website with php
body: <p>Im not sure if its possible or not but Im looking for a PHP script to copy an entire website so that I can save it on my local server and view it when internet is not at my disposal So pretty much something like</p>
  
  <pre><code> &lt;?php    
  function copyDir($source,$dest) {    
  if(is_file($source)) {    
  $cpy= copy($source, $dest);    
  return $cpy;    
  }    
  if(!is_dir($dest)) {     
  mkdir ($dest); }     
  $dir= dir($source);    
  while (false !== $entry = $dir-&gt;read()) {     
   if ($entry == "." || $entry == "..") {    
  continue; }    
  if ($dest !== "$source/$entry") {       
  copyDir("$source/$entry", "$dest/$entry");    
  }     
  }    
  $dir-&gt;close();    
  return true;    
  } ?&gt;    
  </code></pre>
  
  <p>But to copy a website instead of a directory....
  I hope that makes sense </p>