Hello I have this code to show image from folder in php :
$handle = opendir(dirname(realpath(__FILE__)).'/galerija/accomodation/');
while($file = readdir($handle)) {
if($file !== '.' && $file !== '..') {
echo '<img src="galerija/accomodation/'.$file.'" rel="colorbox" />';
}
}
and it's working everthing is fine but how can I set to show folder sorter by name or something, because I really need to sort that images and this script show's only random images.Thank you.