function CopyDir($in,$to) {
$dir=opendir($in);
while ($a=readdir($dir)) {
if ($a=='.' or $a=='..') continue;
if (is_file($in.'/'.$a)) {
copy($in.'/'.$a,$to.'/'.$a); }
else {
if (!is_dir($to.'/'.$a)) {
mkdir($to.'/'.$a); }
mass_copy($in.'/'.$a,$to.'/'.$a); } }
closedir($dir);
return $in;
}
Функция копирования папки с вложеными в нее папками и файлами произвольной вложености
12 лет назад

