Created
September 17, 2016 09:05
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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