mkdir($forum, 0700); recuse_copy('example',$forum); 

Does not work, what is the error?

Closed due to the fact that off-topic participants are Visman , Pavel Mayorov , Regent , Vladimir Glinskikh , Aries 24 Oct '15 at 5:21 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Regent, Vladimir Glinskikh, Aries
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • But is there such a function? there is no such feature for mine - Anton Kotin
  • Could you describe the problem in more detail? I mean, could you show a mistake? - user1679

1 answer 1

 <?php function copyFile($dirname,$dirdestination) { $dir = opendir($dirname); while (($file = readdir($dir)) !== false) { if(is_file($dirname."/".$file)) { copy($dirname."/".$file, $dirdestination."/".$file); } if(is_dir($dirname."/".$file) && $file != "." && $file != "..") { if(!is_dir($dirdestination."/".$file)) { mkdir($dirdestination."/".$file); } copyFile("$dirname/$file","$dirdestination/$file"); } } closedir($dir); } ?>