I want to copy a folder containing files to another destination using php. I found a code snippet, but I'm not getting how it works.
Is it possible to copy folder to another folder?
copyfolder('folder', 'folder_copy');
function copyfolder($source, $destination)
{
$directory = opendir($source);
mkdir($destination);
while(($file = readdir($directory)) != false)
{
copy($source.'/' .$file, $destination.'/'.$file);
}
}