0
配列に8個の値を含む配列があり、同じteacher_name
,school_name
およびmonth_year
の日付要素をグループ化する必要があります。 date要素は、同じ教師名、学校、月と年の組み合わせに従った配列になります。私は以下のようにしたい他の要素で配列要素をグループ化する
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)
)
)