title: PHP copy all files in a directory to another?
body: <p>I am trying to copy files to from a specific folder ($src) to a specific destination ($dst). I obtained the code from this tutorial <a href="https://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php">here</a>. I can't seem to manage to copy any files within the source directory.</p>
  
  <pre><code>&lt;?php
  
  
  $src = 'pictures';
  $dst = 'dest';
  
  function recurse_copy($src,$dst) { 
      $dir = opendir($src); 
      @mkdir($dst); 
      while(false !== ( $file = readdir($dir)) ) { 
          if (( $file != '.' ) &amp;&amp; ( $file != '..' )) { 
              if ( is_dir($src . '/' . $file) ) { 
                  recurse_copy($src . '/' . $file,$dst . '/' . $file); 
              } 
              else { 
                  copy($src . '/' . $file,$dst . '/' . $file); 
              } 
          } 
      } 
      closedir($dir); 
  } 
  
  ?&gt;
  </code></pre>
  
  <p>I am not getting any errors for the above code.</p>