代码拉取完成,页面将自动刷新
<?php
/*复制xCopy函数用法:
* xCopy("feiy","feiy2",1):拷贝feiy下的文件到 feiy2,包括子目录
* xCopy("feiy","feiy2",0):拷贝feiy下的文件到 feiy2,不包括子目录
*参数说明:
* $source:源目录名
* $destination:目的目录名
* $child:复制时,是不是包含的子目录
*/
function xCopy($source, $destination, $child){
if (!file_exists($destination))
{
if (!mkdir(rtrim($destination, '/'), 0777))
{
//$err->add($_LANG['cannt_mk_dir']);
return false;
}
@chmod($destination, 0777);
}
if(!is_dir($source)){
return 0;
}
if(!is_dir($destination)){
mkdir($destination,0777);
}
$handle=dir($source);
while($entry=$handle->read()){
if(($entry!=".")&&($entry!="..")){
if(is_dir($source."/".$entry)){
if($child)
xCopy($source."/".$entry,$destination."/".$entry,$child);
}
else{
copy($source."/".$entry,$destination."/".$entry);
}
}
}
return 1;
}
/*删除deldir函数用法:
* deldidr("feiy"):删除feiy,包括子目录
*参数说明:
* $dir:要删除的目录名
*/
function deldir($dir) {
if (!file_exists($dir)){return true;
}else{@chmod($dir, 0777);}
$dh=opendir($dir);
while ($file=readdir($dh)) {
if($file!="." && $file!="..") {
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) {
unlink($fullpath);
} else {
deldir($fullpath);
}
}
}
closedir($dh);
if(rmdir($dir)) {
return true;
} else {
return false;
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。