okay jeg fandt det her script som skulle kunne gøre det:
<?php /** * Copy a file, or recursively copy a folder and its contents * * @author Aidan Lister <aidan@php.net> * @version 1.0.1 * @param string $source Source path * @param string $dest Destination path * @return bool Returns TRUE on success, FALSE on failure */ function copyr($source, $dest) { // Simple copy for a file if (is_file($source)) { return copy($source, $dest); }
// Make destination directory if (!is_dir($dest)) { mkdir($dest); }
// Loop through the folder $dir = dir($source); while (false !== $entry = $dir->read()) { // Skip pointers if ($entry == '.' || $entry == '..') { continue; }
// Deep copy directories if ($dest !== "$source/$entry") { copyr("$source/$entry", "$dest/$entry"); } }
// Clean up $dir->close(); return true; }
?>
men hvordan beskriver jeg hvilken folder der skal kopieres og hvor den skal kopieres hen ? Hvis vi f.eks. siger at filerne fra mappe1 skal flyttes til mappe2 ?
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.