我有这个数组:
Array
(
[0] => Array
(
[id] => 1
[type] => 1
[s] => 123
)
[1] => Array
(
[id] => 2
[os_type] => 2
[token] => fdsfsdfsd
)
[2] => Array
(
[id] => 2
[type] => 1
[s] => oidshiufjsd
)
[3] => Array
(
[id] => 1
[type] => 1
[s] => sdjfdhskjfdsh
)
[4] => Array
(
[id] => 2
[type] => 1
[s] => sdjfhdsfkjds
)
我想通过密钥type
whitout foreach对此数组进行排序。我希望得到类似的东西:
1 => Array(
[id] => 1
[s] => 123
),
.....
2 => Array(
[id] => 2,
[s] => fdsfsdfsd
)
......
这个想法是按类型构建这个数组。请帮助我.. Thx提前和抱歉我的英语