The getDirectory function is totally awesome! and exactly what i needed. here's the thing tho: when i was hacking it up on my dev box it was working great. but then, once i got it the way i wanted it, i uploaded the files to the web server, and now everything is coming up in random order.
is there a way to force it to read alphabetically? Is is my web server? is it something else entirely?

anybody know of this issue?
TIA
~joel
Here's my code:
PHP Code:
function getDirectory( $path = '.', $level = 0 ){
$ignore = array( 'cgi-bin', '.', '..' );
$dh = @opendir( $path );
while( false !== ( $file = readdir( $dh ) ) ){
if( !in_array( $file, $ignore ) ){
if( is_dir( "$path/$file" ) ){
$dir = $path . $file;
echo "<div class=\"highslide-gallery\">\n
<center>
<a id=\"gallery-opener\" href=\"javascript:;\" onclick=\"document.getElementById('thumb$level').onclick()\">$file</a>\n
</center>
<div class=\"hidden-container\">\n";
$dh1 = @opendir( $dir );
while( false !== ( $image = readdir( $dh1 ) ) ){
if( !in_array( $image, $ignore ) ){
if( !is_dir( "$dir/$image" ) ){
echo "<a id=\"thumb$level\" class='highslide' href='$dir/$image' title=\"\" onclick=\"return hs.expand(this, config$level)\">$image</a>\n";
}
}
}
echo "</div>\n</div>\n\n";
$level++;
}
}
}
closedir( $dh );
}
getDirectory('images/');