Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. function rd ($path) {
  3. $exclude = array('', '.', '..');
  4. foreach (array_diff(scandir($path), $exclude) as $file) {
  5. if (is_file($path . DIRECTORY_SEPARATOR . $file)) {
  6. unlink($path . DIRECTORY_SEPARATOR . $file);
  7. } else {
  8. rd($path . DIRECTORY_SEPARATOR . $file);
  9. }
  10. }
  11. rmdir($path);
  12. }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement