}
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;
}
}
?>