Last active
August 29, 2015 14:21
-
-
Save folmert/3390d1d687e186122b75 to your computer and use it in GitHub Desktop.
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
<?php | |
function delFolder($dirPath) { | |
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path) { | |
$path->isDir() ? rmdir($path->getPathname()) : unlink($path->getPathname()); | |
} | |
rmdir($dirPath); | |
} | |
delFolder('demo'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment