0
我有一個包含具有8個值的數組的數組,我想將具有相同的teacher_name
,school_name
和month_year
的日期元素分組。日期元素將按照相同的教師姓名,學校和月份和年份組合的數組。由其他元素組成的數組元素
下面是整個陣列需要過濾:
Array
(
[0] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Jun 16
[starttime] => 04:04 PM
[endtime] => 05:04 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 09
)
[1] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Jun 16
[starttime] => 04:04 PM
[endtime] => 05:04 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 12
)
[2] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Oct 16
[starttime] => 04:08 PM
[endtime] => 05:08 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 01
)
[3] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Oct 16
[starttime] => 04:08 PM
[endtime] => 05:08 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 02
)
[4] => Array
(
[teacher_name] => CF
[school_name] => School 2
[month_year] => Oct 16
[starttime] => 04:08 PM
[endtime] => 05:08 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 11
)
[5] => Array
(
[teacher_name] => CF
[school_name] => School 2
[month_year] => Oct 16
[starttime] => 04:08 PM
[endtime] => 05:08 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => 22
)
)
我要象下面這樣:
Array
(
[0] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Jun 16
[starttime] => 04:04 PM
[endtime] => 05:04 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => Array(09, 12)
)
[1] => Array
(
[teacher_name] => CF
[school_name] => School 1
[month_year] => Oct 16
[starttime] => 04:04 PM
[endtime] => 05:04 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => Array(01, 02)
)
[3] => Array
(
[teacher_name] => CF
[school_name] => School 2
[month_year] => Oct 16
[starttime] => 04:04 PM
[endtime] => 05:04 PM
[total_minutes] => 60
[teacher_rate] => 20
[date] => Array(11, 22)
)
)