我只想总结 1 个键,但按其他 2 个键排序:
<?php
Array
(
[0] => Array
(
[week] => 1
[info] => a
[hours] => 4
)
[1] => Array
(
[week] => 2
[info] => a
[hours] => 4
)
[2] => Array
(
[week] => 2
[info] => a
[hours] => 4
)
[3] => Array
(
[week] => 2
[info] => b
[hours] => 4
)
[4] => Array
(
[week] => 2
[info] => c
[hours] => 4
)
[5] => Array
(
[week] => 3
[info] => b
[hours] => 4
)
[6] => Array
(
[week] => 3
[info] => b
[hours] => 4
)
)
?>
我想总结按周排序的时间。每周都有信息。所以首先我想总结每个信息的小时数,然后按周对它们进行排序。
例子:
week:1 info:a hours:4
week:2 info:a hours:8
week:2 info:b hours:4
week:2 info:c hours:4
week:3 info:b hours:8
如何才能做到这一点?