I am wondering how I would re-write this code so that directories found are sorted aplhabetically..
<?PHP
$filearray = array();
if ($fil = opendir("apps/$_GET[lang]")) {
while (($file = readdir($fil)) !== false) {
if ($file != "." && $file != "..") {
$filearray[] = $file;
$filepieces = explode(".", "$file");
$filename = $filepieces[0];
//-------------------------
?>
<div class="listbox" style="width: 240px; height: 160px;"> <a href="<?php echo strtolower($file) . ".php"; ?>"><img style="float: left; margin-right: 15px;" src="images/<?php echo $file; ?>.png" border="0" width="48"></a>
<a href="<?php echo strtolower($file) . ".php"; ?>"> <b>
<?php echo $file; ?>
</b> </a>
<p>
<?PHP
$FG = file_get_contents(apps/$_GET[lang]/$filename/caption.php?lang=$_GET[lang]&app=$filename&show=$_GET[show]&csymbol=$_GET[csymbol]¤cy=$_GET[currency]&qun=$_GET[qun]&qpw=$_GET[qpw]&domain=$_GET[qun]");
echo $FG;
?>
</p>
</div>
<?PHP
//-------------------------
}
}
closedir($fil);
}
?>