Answers for "php list directory files by date"

PHP
0

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;
}
Posted by: Guest on August-26-2020

Code answers related to "php list directory files by date"

Browse Popular Code Answers by Language