Have done some searches but cannot find the exact answer I'm looking for.
I would like to take files with numbered file names using "scandir ($ dir)", but sort them correctly. For example, file names:
1-something.ext 2-something-else.ext 3-a-third-name.ext . . . 10-another-thing.ext 11-more-names.ext
The problem I ran into is that the 10-a-fourth thing .ext will show before 2-something-else.ext. I would like to find a better way to solve this problem than typing "0" before all file names.
Any thoughts? Thanks.
source share