时间:2021-07-01 10:21:17 帮助过:5人阅读
copy_module_file("123","345",array('1','2','3','4')); function copy_module_file($path,$newp,$ex){ if(!is_dir($newp)){ mkdir($newp); } if (file_exists($path)){ if(is_file($path)){ copy($path,$newp); } else{ $handle = opendir($path); while (($file = readdir($handle))!='') { if (($file!=".") && ($file!="..") && ($file!="")){ if (is_dir("$path/$file") && in_array($file,$ex)){ //后面一段是复制指定目录 copy_module_file("$path/$file","$newp/$file"); } else{ copy("$path/$file","$newp/$file"); } } } closedir($handle); } }}
http://blog.csdn.net/lijpwsw/article/details/6790461