Ok, so I have this page that will goto a DIr and list all the files in it and goto the next DIr under it and clist the files etc etc etc (here it is w/ my comments):
<?php
require("login.php");
require("config.php");
require("ipaccess.php");
echo"$top $top2";
RecurseDir("memfiles");
function RecurseDir($directory)
{
$thisdir = array("name", "struct");
$thisdir['name'] = $directory;
if ($dir = @opendir($directory))
{
$i = 0;
while ($file = readdir($dir))
{
if (($file != ".")&&($file != ".."))
{
$reallink = $directory."/".$file; $printlink = substr("$reallink", 9, 128);
$checkingfordot = substr("$reallink", -4,1);
if ($checkingfordot !== ".")
{
echo " <a href=\" ".$reallink."/\" target=\"_new\" class=\"links\">".$printlink."</a>-<br> ";
}
else
{
echo "<a href=\"" . $reallink . "\"target=\"_new\" class=\"links\">" . $printlink . "</a>-<br>";
} if (is_dir($reallink))
{
$thisdir['struct'][] = RecurseDir($reallink,$file);
}
else
{
$thisdir['struct'][] = $file;
}
$i++;
}
}
if ($i == 0)
{
$thisdir['struct'] = -2;
}
}
else
{
$thisdir['struct'] = -1;
}
return $thisdir;
}
?>
Mow I have this set to list file and a link to them the download them and a link to opne a window if the DIr is empty.
What I'd like to do is sort this alpabeticly. I've been reading around and all I see is sorting by KEY's. Does anyone know how I can sort this??
Thanks alot..