Question:
My question is how to get or split an array by year using in array key date by ascending order,I’ve tried many… but I didn’t get it,
Answer:
This is a demo on how to transform your input array in the expected output object using javascript:And this is the same logic implemented using php:
https://onlinephp.io/c/87510
If you have better answer, please add a comment about this, thank you!