Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/02/2014, 11:56
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: ordenar archivo por fecha de creacion

Con eso estaria ok

Código PHP:
<?php
setlocale
(LC_ALL"esp");
$directorio='./cias/'.$_GET['cia'].'/info.';
$ficheros1  scandir($directorio,1);
$arrlength=count($ficheros1);
    if(
$arrlength-2>0){    
        echo
"<table width='990'>
            <tr>
                <th colspan='2'>INFORMACIONES VARIAS</th>
            </tr>
            <tr>
                <td class= 'subtit'>Documento</td>
                <td class= 'subtit'>Fecha de Creacion</td>
            </tr>"
;
    for(
$x=0;$x<$arrlength-2;$x++){
        
$nombre_archivo $ficheros1[$x];
        
$fecha strftime("%d de %B de %Y"filemtime("$directorio/$nombre_archivo"));
        
$todo[filemtime("$directorio/$nombre_archivo")]=array($directorio,$ficheros1[$x],$fecha);
        }
    }
?>

<tr OnMouseOut="this.style.background='transparent';" onMouseOver="this.style.background='#0960CE'" >
<?php
krsort
($todo);
for(
$i=0$i<count($todo); $i++){
    
$dato=current($todo);
echo
"
                <td><a target='_blank' href='"
.$dato[0]."/".$dato[1]."'>".$dato[1]."</a><br></td>
                <td>"
.$dato[2]."</td>
            </tr>"

next($archivos);            
}
?>
</table>