Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/03/2014, 20:31
Avatar de enlinea777
enlinea777
 
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 16 años
Puntos: 127
Respuesta: Enlistar archivos por fechas

Pues es algo asi, pequeño saltamontes


Código PHP:
<?php
//ruta a la carpeta, '.' es carpeta actual
$path=".";
$no_mostrar=Array("",".","php");
$dir_handle = @opendir($path) or die("No se pudo abrir $path");
while (
$file readdir($dir_handle)) {
    
$pos=strrpos($file,".");
    
$extension=substr($file,$pos);
    if (!
in_array($extension$no_mostrar)) {
        
$FechaDelArchivo=filemtime(dirname(__FILE__)."/".$file);
        
$archivos[$FechaDelArchivo]=$file;
    }
    }
closedir($dir_handle);
krsort($archivos);//REORDENO POR FECHAS
foreach ($archivos as  $value) { // RECORRER EL ARREGLO ORDENADO
    
echo "<li><a href=\"$value\" id=\"enlace_$value\" title=\"$value\">$value</a></li>";
}

?>