I have JSON object as below, i am trying to group and push this object by first set of keys.
main = {"answer_options":{
"1":{"1":"optical projection<\/p>\r\n","2":"optical mechanism projection<\/p>\r\n","3":"mechanical projection<\/p>\r\n","4":"all the above<\/p>\r\n"},
"2":{"5":"Greenwich to the place<\/p>\r\n","6":"equator to the poles<\/p>\r\n","7":"equator to the nearer pole<\/p>\r\n","8":"equator to the nearer pole along the meridian of the place<\/p>\r\n","9":"none of these.<\/p>\r\n"}},
"question":
{"1":"The stereo plotting instruments are generally manufactured on the principle of<\/p>\r\n","2":"Latitude of a place is the angular distance from<\/p>\r\n"}
};
I trying to get the output as below.. Can any one help on this.
{"1" :
{{"1" : "The stereo plotting instruments are generally manufactured on the principle of<\/p>\r\n"},
{"1":"optical projection<\/p>\r\n","2":"optical mechanism projection<\/p>\r\n","3":"mechanical projection<\/p>\r\n","4":"all the above<\/p>\r\n"}},
{"2":
{{"2" : "Latitude of a place is the angular distance from<\/p>\r\n"},
{"5":"Greenwich to the place<\/p>\r\n","6":"equator to the poles<\/p>\r\n","7":"equator to the nearer pole<\/p>\r\n","8":"equator to the nearer pole along the meridian of the place<\/p>\r\n","9":"none of these.<\/p>\r\n"}}
}
{{is not valid JSON. Everything inside{}must be"key":value{"question": { "1": "The stereo..."}, "answer_options": {"1": "optical projection", "2": "optical mechanism", ...}}