且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多维数组 - 按月分组

更新时间:2023-01-29 20:57:20

试试这个(假设你展示的数组被分配给变量 $old_array):

Give this a try (it assumes the array you showed is assigned to the variable $old_array):

foreach ($old_array as $key => $value) {
  $new_array[$value[0]][] = array($value[1], $value[2]);
}
// Uncomment the next line to print the new array
// print_r($new_array);