Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
PHP recursive rmdir
SUBMITTED BY:
Guest
DATE:
July 12, 2013, 8:34 a.m.
FORMAT:
Text only
SIZE:
365 Bytes
Raw
Download
Tweet
HITS:
1116
Go to comments
Report
public function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus