如何对包含数字的字符串数组进行排序.
例如,我使用了glob()函数来获取文件名列表.
默认情况下,数组按升序输出文件,但单独读取每个数字字符而不是整数.
"C://path/to/file/file.tpl"
"C://path/to/file/file1.tpl"
"C://path/to/file/file11.tpl"
"C://path/to/file/file12.tpl"
....
....
"C://path/to/file/file2.tpl"
Run Code Online (Sandbox Code Playgroud)
"C://path/to/file/file.tpl"
"C://path/to/file/file1.tpl"
"C://path/to/file/file2.tpl"
...
...
"C://path/to/file/file11.tpl"
"C://path/to/file/file12.tpl"
Run Code Online (Sandbox Code Playgroud)
是否有PHP函数执行此操作?
非常感谢