<?php
function deletedir($path){
$openpath = opendir($path);
while ($f = readdir($openpath)){
$file = $path.'/'.$f;
if($f != '.' && $f != '..'){
if(is_dir($file)){
deletedir($file);
}else{
unlink($file);
}
}
}
closedir($openpath);
rmdir($path);
}
?>