0

Can someone help/suggest how to return this array in following json structure. I have just started working with php array & json

https://code.sololearn.com/wpt5lmdX4rOr/?ref=app

24th Apr 2018, 3:41 AM
Vivek
4 Answers
+ 1
https://code.sololearn.com/w02uML6CpV6s/#php
24th Apr 2018, 4:40 AM
Adam
Adam - avatar
0
Adam thanks for your suggestion. Its working fine for given array but on adding new items its returning a duplicate item in json for last item in array.
24th Apr 2018, 2:23 PM
Vivek
0
what does new array look like? it should handle just fine.
24th Apr 2018, 3:33 PM
Adam
Adam - avatar
0
Please check my code. i have added an item for day 2 and in json result you can see the last item duplicated. https://code.sololearn.com/wpt5lmdX4rOr/?ref=app
24th Apr 2018, 3:43 PM
Vivek