How can I group by Source and date then SUM Pageviews and revenue this array below
Array
(
[0] => Array
(
[Source] => Analytics
[Date] => 2017-10-31
[Source] => Google
[visits] => 6000
[Pageviews] => 12,214
[Revenue] => 25
)
[1] => Array
(
[Source] => Analytics
[Date] => 2017-10-31
[Source] => Google
[visits] => 600
[Pageviews] => 1015
[Revenue] => 10
)
[2] => Array
(
[Source] => Analytics
[Date] => 2017-10-31
[Source] => Facebook
[visits] => 600
[Pageviews] => 1144
[Revenue] => 40
)
[3] => Array
(
[Source] => Analytics
[Date] => 2017-10-30
[Source] => Google
[visits] => 600
[Pageviews] => 1144
[Revenue] => 10
)
[4] => Array
(
[Source] => Analytics
[Date] => 2017-10-30
[Source] => Facebook
[visits] => 1600
[Pageviews] => 11,445
[Revenue] => 5
)
[5] => Array
(
[Source] => Analytics
[Date] => 2017-10-30
[Source] => Facebook
[visits] => 700
[Pageviews] => 7,445
[Revenue] => 8
)
)
Expected Result
Array
(
[0] => Array
(
[Source] => Analytics
[Date] => 2017-10-31
[Source] => Google
[visits] => 6600
[Pageviews] => 13,229
[Revenue] => 35
)
[1] => Array
(
[Source] => Analytics
[Date] => 2017-10-31
[Source] => Facebook
[visits] => 600
[Pageviews] => 1144
[Revenue] => 40
)
[2] => Array
(
[Source] => Analytics
[Date] => 2017-10-30
[Source] => Google
[visits] => 600
[Pageviews] => 1144
[Revenue] => 10
)
[3] => Array
(
[Source] => Analytics
[Date] => 2017-10-30
[Source] => Facebook
[visits] => 2,300
[Pageviews] => 18,890
[Revenue] => 35
)
)
Source
elements in each array? – Surd