小编Tim*_*Tim的帖子

PHP - 用数字排序文件名数组?

谁能告诉我如何对包含以数字开头的文件名的数组进行排序?因为以11,12,13等开头的字符串被认为低于2,所以我的结果如下:

[0] "1. File one.pdf"
[1] "11. File eleven.pdf"
[2] "12. File twelve.pdf"
[3] "2. File two.pdf"
[4] "3. File three.pdf"

有什么我可以做的正确分类吗?

php arrays sorting string numbers

7
推荐指数
1
解决办法
5018
查看次数

标签 统计

arrays ×1

numbers ×1

php ×1

sorting ×1

string ×1