作者:XC一米_623 | 来源:互联网 | 2018-03-22 21:13
php代码
header("Content-type:text/html;charset=utf-8;");
set_time_limit(0);
$dir_ = dirname(__FILE__)."/tmp/";
$dest = dirname(__FILE__)."/dir/";
$dread = opendir($dir_);
while(false != ($df = readdir($dread)))
{
if($df != "." && $df != ".."){
if(is_dir($dir_.$df)){
echo "======".$df."======"."
";
echo dirs($dir_.$df."/")."
";
}
}
}
function dirs($d)
{
global $dest;
$od = opendir($d);
while(false != ($ddf = readdir($od)))
{
if($ddf != "." && $ddf != ".."){
copy($d.$ddf,$dest.$ddf);
}
}
}