您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php 复制文件

2025/12/18 21:42:39发布14次查看
php 复制文件
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;
  }
 }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product