Home >Backend Development >PHP Tutorial >Implementation method of php directory copy, php directory copy_PHP tutorial
This article describes the example of php directory copy implementation method. Share it with everyone for your reference. The details are as follows:
function copy_dir($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { copy_dir($src . '/' . $file,$dst . '/' . $file); continue; } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); } copy_dir('e:/www/chat','e:/www/chat3');
I hope this article will be helpful to everyone’s PHP programming design.