Created
April 24, 2017 22:37
-
-
Save eiannone/16513501c4dfb4a0e8f91831111fcf9b to your computer and use it in GitHub Desktop.
deltree e scansione file
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 delTree($dir) { | |
$files = array_diff(scandir($dir), array('.','..')); | |
foreach ($files as $file) { | |
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); | |
} | |
return rmdir($dir); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment