Created
November 29, 2014 20:15
-
-
Save owzim/94bfe7b8822f1759d986 to your computer and use it in GitHub Desktop.
Revisions
-
Christian Raunitschka created this gist
Nov 29, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php class dir { public static function rmRecursive($dir) { $files = array_diff(scandir($dir), array('.','..')); foreach ($files as $file) { is_dir("$dir/$file") ? self::rmdirRecursive("$dir/$file") : unlink("$dir/$file"); } return rmdir($dir); } }