Skip to content

Commit 8167f3d

Browse files
committed
implemented #3 issue.
Now folders and files are ordered by name.
1 parent 04e63e8 commit 8167f3d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dir_listing.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080

8181
while( false !== ($entry = readdir($dir_handle))){
8282

83+
//skip hidden files(optional), current folder ".", parent folder ".."
8384
if ( ( strpos($entry,'.') === 0 and $show_hidden_files===false) | $entry == "." | $entry == ".." ){
8485
continue;
8586
}else if ( is_dir( $full_path.$entry ) ) {
@@ -89,6 +90,10 @@
8990
}
9091
}
9192

93+
//order folder and files
94+
sort($folderlist);
95+
sort($filelist);
96+
9297
//foldere is empty
9398
if(count ($folderlist) == 0 and count ($filelist) == 0){
9499
echo '<br><br><div class="container"><div class="alert alert-info text-center"><strong>This folder is empty</strong></div></div>';

0 commit comments

Comments
 (0)