1
整理文件,我現在用的是下面的PHP代碼從一個文件夾logfiles_patient
從文件夾
$path = "logfiles_patient/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle))
{
if(($file!='.')&&($file!='..'))
{
echo "<a target='_blank' href='log_Patient_download.php?filename=$file'>$file</a>";
}
}
// Close
closedir($dir_handle);
和輸出呼應得到的所有文件是
March 19, 2014.txt
March 20, 2014.txt
March 21, 2014.txt
我要重新排列的輸出作爲
March 21, 2014.txt
March 20, 2014.txt
March 19, 2014.txt
是否文件名與文件創建日期對應? –
是.Filename是文件創建的日期 – Arvie