Created
          November 10, 2016 19:24 
        
      - 
      
 - 
        
Save ConnerAiken/236273cdefaedbc1d1c19696dbfebfd2 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
    
  
  
    
  | /* Deletes files recursively on windows and linux */ | |
| 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