最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 复制目录及目录下所有文件
时间:2009-11-14 编辑:简简单单 来源:一聚教程网
function copy($from, $to) {
if ($this->abspath($to)=="/") $to=$this->basedir;
if ($this->dirname($from) == $this->dirname($to)) $to = $this->dirname($to).'/复件'.basename($from);
if (!is_dir($from)) {
return @copy($from, $to);
} else {
if (!is_dir($to)) @mkdir($to);
$path = opendir($from);
while( $file = readdir( $path ) ) {
if (($file=='.')||($file=='..')) continue;
if (is_dir($from.'/'.$file)) $this->copy($from.'/'.$file, $to.'/'.$file);
else echo basename($file), copy($from.'/'.$file, $to.'/'.$file) ? ' Success!' : ' False.', '
';
}
return true;
}
}
-
上一个: php 删除目录及所有文件
-
下一个: php 文件在线解压代码
相关文章
- php复制目录下所有文件到另一目录中 04-06
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24