Cita:
Iniciado por Ronruby
¿Que error te da?
tengo este script:
<?php
include 'fecha.php'; //valor en variable $fecha
$path="files";
$handle = opendir($path);
while($file = readdir($handle))
{
if($file != "." && $file != ".." && $file != "Thumbs.db")
{
$path2 = "$path/$file";
$handle2 = opendir($path2);
while($file2 = readdir($handle2))
{
if($file2 != "." && $file2 != ".." && $file2 !="Thumbs.db")
{
if(fileatime("$path2/$file2") >= $fecha)
{
if(unlink("$path2/$file2"))
{
rmdir("$path2");
}
}
}
}
}
}
?>