Posted By

fackz on 01/07/10


Tagged

time list dir files


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

fackz
netzwerktourist


get a list of files ordered by upload time


 / Published in: PHP
 

This is another way to get a list of files ordered by upload time.

  1. <?php
  2. foreach (glob("../downloads/*") as $path) { //configure path
  3. $docs[filectime($path)] = $path;
  4. } ksort($docs); // sort by key (timestamp)
  5.  
  6. foreach ($docs as $timestamp => $path) {
  7. print date("d. M. Y: ", $timestamp);
  8. print '<a href="'. $path .'">'. basename($path) .'</a><br />';
  9. }
  10. ?>

Report this snippet  

You need to login to post a comment.