Hello,
I would like to ask on how to sort files by date modified and displaying the top 20 latest date.
Heres, my sample function that would return the files to be displayed
This function should return an array that are sorted already.
I would like to ask how to sort this files by date (return and order by: only top 20 latest date).
Any suggestions is appreaciated.. Thnks.:)
I would like to ask on how to sort files by date modified and displaying the top 20 latest date.
Heres, my sample function that would return the files to be displayed
Code:
function get_dir_file($dir_path)
{
$file_arr = array();
if ($handle = opendir($dir_path)) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." )
{
$file_arr[] = $file;
}
}
closedir($handle);
}
return file_arr;
}
I would like to ask how to sort this files by date (return and order by: only top 20 latest date).
Any suggestions is appreaciated.. Thnks.:)
Comment