title: Copy all files from one folder to another Folder using PHP scripts?
body: <p>Basically, my requirement is, I want to move all files from one folder to another folder using PHP scripts. Any one can help me. I am trying this, but I am getting error</p>
  
  <pre><code> $mydir = dirname( __FILE__ )."/html/images/";
     if(!is_dir($mydir)){
         mkdir("html/images");
     } 
     // Move all images files
     $files = glob("images/*.");
     foreach($files as $file){
     $file_to_go = str_replace("images/","html/images/",$file);
         copy($file, $file_to_go);
     }
  </code></pre>