PHP Copiar un arbol de carpetas y archivos sin limite de niveles

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP Copiar un arbol de carpetas y archivos sin limite de niveles相关的知识,希望对你有一定的参考价值。

function copiarArbol($source, $dest){ 
	$folder = opendir($source);
	while($file = readdir($folder)){
		if ($file == '.' || $file == '..') continue;
		if(is_dir($source.'/'.$file)){
			if( !is_dir($dest.'/'.$file)) mkdir($dest.'/'.$file, 0666);
			copiarArbol($source.'/'.$file , $dest.'/'.$file);
		}else{
			if(strrchr($file,'.') != '.db'){
				copy($source.'/'.$file , $dest.'/'.$file );
				chmod($dest.'/'.$file , 0666);
			}
		}
	}
	closedir($folder);
	return 1;
}

以上是关于PHP Copiar un arbol de carpetas y archivos sin limite de niveles的主要内容,如果未能解决你的问题,请参考以下文章