Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Ordenar Ficheiros por data

$
0
0
Boas estou com uma duvida eu tenho este ficheiro PHP para ir buscar uns ficheiros a um diretorio FTP.
Mas queria ordenar los por data como posso fazer lo?

Código (PHP):
  while($file = $contents[$count])
                {
        $data[$count][year] = substr($file,35,2); // position 11 because of: "warserver1-09...
        $data[$count][month] = substr($file,37,2);
        $data[$count][day] = substr($file,39,2);
        $data[$count][hour] = substr($file,41,2);
        $data[$count][minute] = substr($file,43,2);
        $data[$count][map] = substr($file,46,-4);
        $data[$count][name] = $file;
        $count++;
  }
         
  echo ("<table class='TableReports'>");
  echo ("<tr align='center'>");
  echo ("<td>Mapa</td>");
  echo ("<td>Data</td>");
  echo ("</tr>");

foreach($data as $field)
{
  $nome_demo = $field[name];
  echo ("<td>$field[map]</td>");
  echo ("<td>$field[day]/$field[month]/20$field[year] - $field[hour]:$field[minute]</td>");
  echo ("</tr>");
}
echo ("</table>");

Viewing all articles
Browse latest Browse all 14700

Trending Articles