This code is sorting the images alphabetically. How to do sorting by date? So users will be more convenient to view the new image.
Here is the code:
<link href="assets/css/gallery.css" rel="stylesheet">
<link href="assets/css/dope.css" rel="stylesheet">
<div class="row center">
<ul class="uk-tab" id="gamemodelistregion" uk-switcher="connect: + ul; animation: uk-animation-fade">
<li aria-expanded="true" class="uk-active">
<a>All skins</a>
<?php
# Skin directory relative to include/gallery.php (this file)
$skindir = "../skins/";
# Skin directory relative to index.html
$skindirhtml = "./skins/";
$images = scandir($skindir);
foreach($images as $curimg) {
if (strtolower(pathinfo($curimg, PATHINFO_EXTENSION)) == "png") {
?>
<li class="skin" onclick="$('#nick').val('{' + $(this).find('.title').text() + '} ');" data-dismiss="modal">
<div class="circular" style='background-image: url("./<?php echo $skindirhtml.$curimg ?>")'></div>
<h4 class="title"><?php echo pathinfo($curimg, PATHINFO_FILENAME); ?></h4>
</li>
<?php
}
}
?>
</li>
</ul>
</div>