Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php list directory files by date

function listdir_by_date($path){

  $ar = [];
  chdir($path);
  array_multisort(array_map('filemtime', ($files = glob("*.*"))), SORT_DESC, $files);
  foreach($files as $filename)
  {
    $ar[] = $filename;
  }

  return $ar;
}
 
PREVIOUS NEXT
Tagged: #php #list #directory #files #date
ADD COMMENT
Topic
Name
4+1 =