Skip to content

Instantly share code, notes, and snippets.

@asilbalaban
Created September 17, 2016 09:05
Show Gist options
  • Save asilbalaban/b40ba45ee785f7bbfb6cf379a94af7d6 to your computer and use it in GitHub Desktop.
Save asilbalaban/b40ba45ee785f7bbfb6cf379a94af7d6 to your computer and use it in GitHub Desktop.
İçi dolu klasörleri klasörle beraber silmek için yazılmış sorunsuz çalışan bir fonksiyon
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment