Skip to content

Instantly share code, notes, and snippets.

@liconti
liconti / rrmdir.php
Created April 20, 2012 06:26
PHP recursive rmdir
<?php
function rrmdir($path){
if (is_dir($path)) {
array_map( "rrmdir", glob($path . DIRECTORY_SEPARATOR . '{,.[!.]}*', GLOB_BRACE) );
@rmdir($path);
}
else {
@unlink($path);
}
}