Ver Mensaje Individual
  #12 (permalink)  
Antiguo 21/10/2008, 10:02
AlvaroX
 
Fecha de Ingreso: septiembre-2008
Mensajes: 242
Antigüedad: 15 años, 7 meses
Puntos: 3
Respuesta: Eliminar Directorios

Cita:
Iniciado por Ronruby Ver Mensaje
¿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");
}
}
}
}
}
}

?>