sort files by date in PHP

后端 未结 5 1563
天涯浪人
天涯浪人 2020-11-22 07:15

I currently have an index.php file which allows me to output the list of files inside the same directory, the output shows the names then I used filemtime() function to show

5条回答
  •  攒了一身酷
    2020-11-22 08:00

    $files = array_diff(scandir($dir,SCANDIR_SORT_DESCENDING), array('..', '.'));
    print_r($files);
    

提交回复
热议问题