【发布时间】:2017-05-25 06:44:11
【问题描述】:
我有一个多图库页面,显示按文件夹分隔的图像。问题是它按字母顺序(文件夹名称)显示在我的页面中,如何将其更改为日期文件夹被修改为排序并显示在我的页面中?
<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标签?