2 sets of data:
Fisrt:
{"id":65,"data1":1,"color":"red"}
{"id":65,"data1":1,"color":"black"}
{"id":65,"data1":1,"color":"blue"}
{"id":65,"data1":1,"size":"small"}
{"id":65,"data1":1,"size":"medium"}
{"id":65,"data1":1,"size":"large"}
And another with:
{"id":66,"data1":5,"color":"red"}
{"id":66,"data1":5,"color":"yellow'}
{"id":66,"data1":5,"color":"white"}
{"id":66,"data1":5,"size":"small"}
{"id":66,"data1":5,"size":"medium"}
{"id":66,"data1":5,"size":"X-large"}
ID and data1 are present in both.
I need to hace this:
{"id":65,"data1":1,"color":["red","black","blue"] ,"size":["small","medium","large"]}
{"id":66,"data1":5,"color":["red","yellow","white"],"size":["small","medium","X-large"]}
Any for a simple solution?
to hace ?
looks like json. you could transform this in a multidimensional array and use it from there
that is 'hand made'. I want to have that from the 2 sets
so you want to merge 2 datasets to 1 ?
my approach would be to add everything to an array together and then format it back to json
Обсуждают сегодня