<? function old($papka,$times){ $old_time = time()-60*$times; $dir = opendir ($papka); while ($file = readdir ($dir)) { if (( $file != ".") && ($file != "..")) $files[]="$papka/$file"; $time[]=filemtime("$papka/$file" ); } closedir ($dir); $count_files = count($files); for($i = 1; $i< $count_files; $i++){ if($time[$i] <= $old_time){ @unlink($files[$i]); } } } ?>
Da
Можно и через один цикл