<?php
foreach (glob("POSTS/*.txt") as $filename)
{
$file = fopen($filename, 'r') or exit("Unable to open file!");
//Output a line of the file until the end is reached
echo date('D, M jS, Y H:i a', filemtime($filename))."<br>";
echo '<h2>' . htmlspecialchars(fgets($file)) . '</h2>';
while(!feof($file))
{
echo fgets($file). "<br>";
}
echo "<hr/>";
}
fclose($file);
?>
我正在写一个博客,并且已经能够输入文件,但只能首先输入最旧的文件
我怎么做才能让我首先在最新日期之前输入它们?
谢谢