Hello!
I need to copy the files from a directory(dir_org) to another directory (dir_dst).
Here there is my code, but copy doesn't work.
I've verified that the name of the directory are right. In my code i verify too, that the file that the function readdir reads , isn't a parent or current directory.
if ($handle = opendir($dir_org))
{
while (false !== ($file = readdir($dir_org)))
{
$file_dst = $dir_dst."/".$file;
if (($file!=".") AND ($file!=".."))
{ if (!copy ($file,$file_dst))
{ echo "Error!";
exit();
}
}
}
}
closedir($dir_org);
Another idea to cpy directory?
Thanks in advance!
Router 🙂