title: move all files and folders in a folder to another?
body: <p>I want to move all files and folders inside a folder to another folder. I found a code to copy all files inside a folder to another folder. 
  <a href="https://stackoverflow.com/questions/608450/using-scandir-to-find-folders-in-a-directory-php">move all files in a folder to another</a></p>
  
  <pre><code>// Get array of all source files
  $files = scandir("source");
  // Identify directories
  $source = "source/";
  $destination = "destination/";
  // Cycle through all source files
  foreach ($files as $file) {
    if (in_array($file, array(".",".."))) continue;
    // If we copied this successfully, mark it for deletion
    if (copy($source.$file, $destination.$file)) {
      $delete[] = $source.$file;
    }
  }
  // Delete all successfully-copied files
  foreach ($delete as $file) {
    unlink($file);
  }
  </code></pre>
  
  <p>How do I change this to move all folders and files inside this folder to another folder.</p>