/ Published in: PHP
Helpfull function to remove recursively specific folders.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function removeDirs($path, $dirName, $delete = false) { if($file != '.' && $file != '..') { $fullpath = $path.'/'.$file; if ( $delete ) { } } else { if ( $file == $dirName ) { removeDirs($fullpath, $dirName, true); } else { removeDirs($fullpath, $dirName, $delete); } if ( $delete ) { } } } } } //example call removeDirs('/var/www/temp', '.svn');