<? $way = 'cache/'; $dir = opendir($way); while ($file = readdir($dir)) { if($file != '.' AND $file != '..' AND $file != '.htaccess') { unlink($way . $file); } } closedir($dir); echo 'Очищено!'; ?>