Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function rd ($path) {
- $exclude = array('', '.', '..');
- foreach (array_diff(scandir($path), $exclude) as $file) {
- if (is_file($path . DIRECTORY_SEPARATOR . $file)) {
- unlink($path . DIRECTORY_SEPARATOR . $file);
- } else {
- rd($path . DIRECTORY_SEPARATOR . $file);
- }
- }
- rmdir($path);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement