Hi,
I am trying to make a simple php photo gallery, I have this code, but the only problem is that the photos appear in a random order.
How can I get the photos to appear alphabetically or numerically?
<?php
if ($handle = opendir('photos/')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$photos .= '
<img src="thumbs.php?src='.$file.'&f=2&t=3" alt="'.$file.'" title="'.$file.'"/>
';
}
}
closedir($handle);
}
?>
<?php print $photos; ?>
Thank you