如何以反向aplhabetical顺序打印目录文件?这就是我目前使用的:
foreach (glob("edit/news/*.txt") as $filename)
{
include $filename;
}
文件按日期发布顺序打印,因此文件的名称如下:
20111214210118.txt
2011 12 14 21 01 18
Year, Month, Day, Hour, Minute, Second
答案 0 :(得分:4)
非常确定rsort
正是您所寻找的。 p>
$files = glob("edit/news/*.txt");
rsort($files);
foreach($files as $filename) {
include $filename;
}