I have the below code.
is there a way to sort opendir? Ie if files are named file-01.txt file-02.txt?
I could probaby fill and array then sort that, but don't want to add that step...
Thanks.
Code:
if ($dir = @opendir("./")) {
while (($file = readdir($dir)) !== false) {
#do some stuff
}
closedir($dir);
}
is there a way to sort opendir? Ie if files are named file-01.txt file-02.txt?
I could probaby fill and array then sort that, but don't want to add that step...
Thanks.