Friday, October 7, 2011

Using Set library to build custom array

I have an array with this format:

Array (     [0] => Array         (             [0] => Array                 (                     [year] => 2011                     [month] => 8                 )          )
...


with different combinations of years and months, ordered chronologically.

I want to get an array that counts the number of month appearances in each year

Array ( [2011] => Array ( [8] => 10
[7] => 15
)

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: