これは私の配列です:
Array (
[0] => Array ( [date] => 28-10-2012 [total] => 100 [earn] => 10 )
[1] => Array ( [date] => 28-12-2012 [total] => 100 [earn] => 10 )
[2] => Array ( [date] => 28-12-2012 [total] => 90 [earn] => 9 )
[3] => Array ( [date] => 28-12-2012 [total] => 315.35 [earn] => 31.535 )
[4] => Array ( [date] => 02-01-2013 [total] => 1500 [earn] => 150 )
[5] => Array ( [date] => 02-01-2013 [total] => 1000 [earn] => 100 )
)
欲望の出力:
Array (
[0] => Array ( [date] => 28-10-2012 [total] => 100 [earn] => 10 )
[1] => Array ( [date] => 28-12-2012 [total] => 505.35 [earn] => 505.535 )
[2] => Array ( [date] => 02-01-2013 [total] => 2500 [earn] => 250 )
)
これまでに試した方法では、日付でグループ化し、2 つの異なる配列を持つ 1 つのフィールドのみを合計します。
Array ( [28-10-2012] => 100 [28-12-2012] => 505.535 [02-01-2013] => 2500)
Array ( [28-10-2012] => 10 [28-12-2012] => 50.535 [02-01-2013] => 250 )
これは私が探しているものとは大きく異なり、まだ頭を悩ませています。可能な方法は何ですか??