Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $it = new RecursiveDirectoryIterator($oldDir, RecursiveDirectoryIterator::SKIP_DOTS);
- $files = new RecursiveIteratorIterator($it,
- RecursiveIteratorIterator::CHILD_FIRST);
- foreach($files as $file) {
- if ($file->isDir()){
- echo "dirRemove... " . $file->getRealPath() . "<br/>";
- rmdir($file->getRealPath());
- } else {
- echo "unlink... " . $file->getRealPath() . "<br/>";
- unlink($file->getRealPath());
- $fileCount++;
- }
- }
- rmdir($dir);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement