php 按子值对数组进行排序
这是我的数组,我想我应该使用 usort 但我不知道如何让它工作。
Array
(
[javascript] => Array
(
[core] => Array
(
[0] => Array
(
[file] => /path/to/file.js
[weight] => 0
)
[1] => Array
(
[file] => /path/to/file2.js
[weight] => 1
)
)
)
)
我想按权重值对核心索引进行排序,其他文件和权重也会在之后添加和排序。
here is my array, I think i should be using usort but i have no idea how to get that working.
Array
(
[javascript] => Array
(
[core] => Array
(
[0] => Array
(
[file] => /path/to/file.js
[weight] => 0
)
[1] => Array
(
[file] => /path/to/file2.js
[weight] => 1
)
)
)
)
I would like to sort the index of core by the weight value, other files and weights will be added and sorted after also.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)