$path = '/var/www/html/Runtime/'; $ite = new RecursiveDirectoryIterator($path);
foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) {
$fn = $cur->getBasename();
if($cur->isDir() || ($fn == '.' || $fn == '..')) continue;
unlink($filename);
} del_dir($path); function del_dir($path){
$filenames = scandir($path);
for($i=0;$i<count($filenames);$i++) {
$filename = $filenames[$i];
$url = $path.$filename."/";
if($filename == '.' || $filename == '..') continue;
del_dir($url);
rmdir($url);
}
rmdir($path);
}
echo "success!";