最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
无限级目录与目录之间的复制代码
时间:2022-07-02 09:16:33 编辑:袖梨 来源:一聚教程网
无限级目录复制,站长原创,虽只写了短短几分钟,但还是挺有用的
$o_path="admin";//源目录
$n_path="n_admin";//新目录
class copy_path
{
function wm_chief_copypath($o_path,$n_path)
{$hand=opendir($o_path);
if(!file_exists($n_path))//目标目录不存在则建立
{$this->wm_chief_createpath($n_path);}
$i=0;
while($file=readdir($hand))
{$i ;
if($i==1||$i==2)
{continue;}
if(!(strchr($file,".")))
{
$o_s_path=$o_path."/".$file;
$n_s_path=$n_path."/".$file;
$this->wm_chief_copypath($o_s_path,$n_s_path);
}
else
{
$o_file=$o_path."/".$file;
$n_file=$n_path."/".$file;
$this->wm_chief_copyfile($o_file,$n_file);
}
}
closedir($hand);
return true;
}
function wm_chief_copyfile($o_file,$n_file)
{
copy($o_file,$n_file);
}
function wm_chief_createpath($n_path)
{
mkdir($n_path,0777);
}
}
$wm_chief=new copy_path();
$wm_chief_ok=$wm_chief->wm_chief_copypath($o_path,$n_path);
if($wm_chief_ok)
{
echo"复制完毕";
}
?>
相关文章
- dpsk人工智能官网-dpsk人工智能最新入口 03-04
- 满蛙漫画在线阅读-MANWA漫蛙官方正版 03-04
- 羞羞漫画网页免费登录入口-羞羞漫画在线首页登录 03-04
- 哔咔漫画PicaPica网页版:2026最新在线阅读地址与APP下载引导 03-04
- zlibrary中文官网-最新入口一键下载 03-04
- deepseek下载官网最新版-Deepseek官方正版 03-04