我正在使用CakePHP 3.6。我有这个数组,我想按季节和类似$ data [“ season”] [“ episode”]的情节对数组进行分组。 考虑到$ data的索引约为1000,我该如何实现?
我了解Hash::combine() ;
但据我了解,这只是一个级别。
谢谢
$data = [
[
"episode" => "01" ,
"season" => "01" ,
"name" => "first" ,
"...." => "......." ,
] ,
[
"episode" => "01" ,
"season" => "01" ,
"name" => "second" ,
"...." => "......." ,
] ,
[
"episode" => "03" ,
"season" => "01" ,
"name" => "third" ,
"...." => "......." ,
] ,
[
"episode" => "01" ,
"season" => "02" ,
"name" => "......." ,
"...." => "......." ,
] ,
];