Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- setlocale(LC_ALL,'en_US.UTF-8');
- // cartella da copiare
- $src = 'F:\FOLDER\Pictures';
- // destinazione
- $dest = 'F:\FOLDER\Personale';
- // copia ricorsiva di tutto il contenuto della cartella sorgente
- recurse_copy($src,$dest);
- function recurse_copy($src,$dst) {
- $dir = opendir($src);
- @mkdir($dst);
- while(false !== ( $file = readdir($dir)) ) {
- $extension = pathinfo($file, PATHINFO_EXTENSION);
- if (($extension != "PSD") and ($extension != "TIFF") and ($extension != "EPS") and ($extension != "DJVU") and ($extension != "CDP") and ($extension != "JPG") and ($extension != "PNG") and ($extension != "GIF") and ($extension != "JPEG") and ($extension != "BMP") and ($extension != "DROPBOX") and ($extension != "INI") and ($extension != "DNG") and ($extension != "NEF") and ($extension != "psd") and ($extension != "tiff") and ($extension != "eps") and ($extension != "djvu") and ($extension != "cdp") and ($extension != "jpg") and ($extension != "png") and ($extension != "gif") and ($extension != "jpeg") and ($extension != "bmp") and ($extension != "dropbox") and ($extension != "ini") and ($extension != "dng") and ($extension != "nef")) {
- if (( $file != '.' ) && ( $file != '..' )) {
- if ( is_dir($src . '/' . $file) ) {
- recurse_copy($src . '/' . $file,$dst . '/' . $file);
- }
- else {
- rename($src . '/' . $file,$dst . '/' . $file);
- }
- }
- }
- }
- closedir($dir);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement