vozue 1 Denunciar post Postado Outubro 8, 2015 Olá, no código abaixo eu listo todos os diretórios e gostaria de implementar deletando todas as pastas vazias. Alguém pode me ajudar? <?php print "<pre>"; $dir = "./"; function listar($dir,$oq = null){ $op = ( ($oq == null) ? $dir : $oq ); if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if( $file != '.' and $file != '..' ){ if( filetype($dir . $file) == "dir" ){ $tmp[$file] = listar($dir.$file."/",$file); for ($i=1; $i<count($dir); $i++) { $num = $dir[$i]; echo ' <li--><img alt="random image" src="'.$num.'" />'; } }else{ $tmp[] = $file; } } } closedir($dh); } } return $tmp; } $arr = listar($dir); natcasesort($arr); print_r( $arr ); echo "teste:"; echo $tmp[$file]; echo $dir; echo $file; ?> Sei que o comando é Rmdir(); mas como não tenho muita sabedoria peço auxilio, obrigado. Compartilhar este post Link para o post Compartilhar em outros sites