Done some searching, but can't seem to find the exact answer I'm looking for.
I'd like to pull in files with numbered filenames using 'scandir($dir)', but have them sort properly. For example, file names are:
1-something.ext
2-something-else.ext
3-a-third-name.ext
.
.
.
10-another-thing.ext
11-more-names.ext
The problem I'm having is that 10-a-fourth-thing.ext will show before 2-something-else.ext. I'd like to find a better way of solving this issue than introducing leading '0' in front of all file names.
Any thoughts? Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…