Teraz, gdy mam pliki x2.php, x11.php, x5.php, x24.php, x9.php, x13.php, x10.php, wyświetla mi je w kolejności:
-x.php
-x.php
-x.php
-x.php
-x.php
-x.php
-x.php
A ja bym chciał, by wyświetlił je w takiej:
-x.php
-x.php
-x.php
-x.php
-x.php
-x.php
-x.php
Aoto kod:
<?php # Do we have a path? if not, it's the current directory $path = $_GET[\"path\"]; $path = \".\"; } //# Print out for navigation //print \"Current path: <b>\" . $path . \"</b><br />\"; # Initialise list arrays, directories and files separately and array counters fo them # Open possibly available directory # Make sure we don't push parental directories or dotfiles (unix) into the arrays if( $file != \".\" && $file != \"..\" && $file[0] != \".\" ) { # Create array for directories $d_arr[$d++] = $file; else # Create array for files $f_arr[$f++] = $file; } } } } # Wrap things up if we're in a directory # Sort and reset the arrays # Print a parent directory link # Print the directory list # Print with query string print \"<img border=/\"0/\" src=/\"../folder.gif/\" width=/\"16/\" height=/\"14/\"> <a href=\"?path=\" . $path . \"/\" . $d_arr[$i] . \"\">\" . $d_arr[$i] . \"</a>/<br />n\"; } # Print file list # Only print path and filename print \"<img border=/\"0/\" src=/\"../img.gif/\" width=/\"14/\" height=/\"16/\"> <a href=\"\" . $path . \"/\" . $f_arr[$i] . \"\"> \" . $f_arr[$i] . \"</a>\"; # We may want a file size. NOTE: needs $path to stat # Size in kilobytes # Size in megabytes print \" \" . round( filesize( $path . \"/\" . $f_arr[$i] ) / 1024 / 1024, 1 ) . \" MB<br />n\"; } else { # Size in bytes } } ?>
---

aleksander