/ Published in: PHP
Delete a directory including its contents.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/***** *@dir - Directory to destroy *@virtual[optional]- whether a virtual directory */ function destroyDir($dir, $virtual = false) { $ds = DIRECTORY_SEPARATOR; { { if ($file == '.' || $file == '..') { continue; } { destroyDir($dir.$ds.$file); } else { } } return true; } else { return false; } }