我有一个多维数组:
Array
(
[type] => Array
(
[0] => text
[1] => portfolio
[2] => slide
[3] => text
)
[grid] => Array
(
[0] => 3
[1] => 5
[2] => 3
[3] => 4
)
[title] => Array
(
[0] => title1
[3] => title2
)
[content] => Array
(
[0] => content1
[3] => content2
)
[item] => Array
(
[1] => 6
[2] => 7
)
[pagination] => Array
(
[1] => 8
)
[order] => Array
(
[1] => desc
[2] => asc
)
)
并希望通过数组中给出的 [type] 键对其进行分组:
Array (
[0] => Array (
[type] => text
[grid] => 3
[title] => title1
[content] => content1
)
[1] => Array (
[type] => portfolio
[grid] => 5
[item] => 6
[pagination] => 1
[order] => desc
)
[2] => Array (
[type] => slide
[grid] => 3
[item] => 7
[order] => asc
)
[3] => Array (
[type] => text
[grid] => 4
[title] => title2
[content] => content2
)
有没有办法或 PHP 函数来做这样的数组分组?