私は複数の画像をフォルダで区切って表示するマルチギャラリーページを持っています。問題はそれが私のページにアルファベット順(フォルダ名)で表示されているのですが、それを日付フォルダに変更してページに並べ替えて表示するにはどうすればいいですか?PHPフォルダの日付順に並べ替える
<div class="pageWrap">
<div class="row">
<div class="col-md-2 col-md-push">
<div class="panel panel-info">
<div class="panel-heading"><center>Gallery</center></div>
</div>
</div>
</div>
<?php $files = scandir('galleries'); ?>
<?php foreach ($files as $file): ?>
<?php $dir = 'galleries/' . $file; ?>
<?php if (is_dir($dir) && $file != '.' && $file != '..'): ?>
<h2><?php echo ucwords($file); ?></h2>
<?php $gallery = UGallery::init()->createGallery($dir, $file); ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
は、なぜあなたは、各行の後にPHPのタグを閉じていますか? – Andreas
[scandir()の可能な複製を日付で並べ替える](https://stackoverflow.com/questions/11923235/scandir-to-sort-by-date-modified) – Andreas