function recursive_copy($src, $dst) { $dir = opendir($src); if (!is_dir($dst)) { @mkdir($dst); } while (false !== ($file = readdir($dir))) { if (($file != '.') && ($file != '..')) { if (is_dir($src . '/' . $file)) { recursive_copy($src . '/' . $file, $dst . '/' . $file); } else { copy($src . '/' . $file, $dst . '/' . $file); } } } closedir($dir); }
I found this function at http://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php.
Its working perfect !! Try it and leave your comments..
enjoy..
Filed under: php Tagged: php
