I am using this function:
function rcopy($src, $dst) {
if (file_exists($dst)) rrmdir($dst);
if (is_dir($src)) {
mkdir($dst);
$files = scandir($src);
foreach ($files as $file)
if ($file != "." && $file != "..") rcopy("$src/$file", "$dst/$file");
}
else if (file_exists($src)) copy($src, $dst);
}
rcopy("$source_folder", "$target_folder");
It works great but I need a way to set the permissions to the $target_folder.
Another got any ideas on how to do this?
Use
chmod()function to the target_folder.