Guest User

Untitled

a guest
Apr 26th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2.  
  3. function _rmdir($dir) {
  4. if (file_exists($dir)){
  5. $files = glob( $dir . '*', GLOB_MARK );
  6. foreach( $files as $file ){
  7. if( substr( $file, -1 ) == '/' )
  8. _rmdir( $file );
  9. else
  10. unlink( $file );
  11. }
  12.  
  13. if (is_dir($dir)) rmdir( $dir );
  14. }
  15. }
  16.  
  17. ?>
Add Comment
Please, Sign In to add comment