As an output from MySQL I got an array like this:
Array
(
[0] => Array
(
[name] => Date
[data] => Array
(
[0] => 2009-07-01
[1] => 2009-08-01
[2] => 2009-09-01
[3] => 2010-10-01
[4] => 2010-11-01
[5] => 2010-12-01
[6] => 2011-01-01
[7] => 2011-02-01
[8] => 2012-03-01
[9] => 2012-04-01
[10] => 2012-05-01
)
)
[1] => Array
(
[name] => Counts
[data] => Array
(
[0] => 13
[1] => 13
[2] => 15
[3] => 16
[4] => 17
[5] => 18
[6] => 19
[7] => 11
[8] => 14
[9] => 14
[10] => 15
)
)
)
For further developing I need to find the highest dates in each year. How to find last date of each year and get it's value from 'counts' array. For above code I would like to achieve something like this:
Array
(
[0] => Array
(
[name] => Date
[data] => Array
(
[1] => 2009-09-01
[2] => 2010-12-01
[3] => 2011-02-01
[4] => 2012-05-01
)
)
[1] => Array
(
[name] => Counts
[data] => Array
(
[1] => 15
[2] => 18
[3] => 11
[4] => 15
)
)