Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $it = new RecursiveDirectoryIterator($oldDir, RecursiveDirectoryIterator::SKIP_DOTS);
  2. $files = new RecursiveIteratorIterator($it,
  3. RecursiveIteratorIterator::CHILD_FIRST);
  4. foreach($files as $file) {
  5. if ($file->isDir()){
  6. echo "dirRemove... " . $file->getRealPath() . "<br/>";
  7. rmdir($file->getRealPath());
  8.  
  9. } else {
  10. echo "unlink... " . $file->getRealPath() . "<br/>";
  11. unlink($file->getRealPath());
  12.  
  13. $fileCount++;
  14. }
  15. }
  16. rmdir($dir);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement