您好我有一個像下面的維生素A JSON數據格式,menrals,我需要合併單個陣列內的同一JSON按鍵陣列,合併相同的密鑰JSON數據
[
{
Vitamins: [
"Please explain details about vitamins.",
"Vitamin is a vitamin.:P:D",
"7"
]
},
{
Vitamins: [
"i need more explanation about VitaminD. bcoz i'm new to medicine field ",
"i don't know the ans.. :P",
"7"
]
},
{
Minerals: [
"i need more info about Minerals!",
"Minerals are found in soils",
"8"
]
}
]
,但我需要改變,因爲,請幫助如何合併它
[
{
Vitamins: [
{
"Please explain details about vitamins.",
"Vitamin is a vitamin.:P:D",
"7"
},
{
"i need more explanation about VitaminD. bcoz i'm new to medicine field ",
"i don't know the ans.. :P",
"7"
}
]
},
{
Minerals: [
"i need more info about Minerals!",
"Minerals are found in soils",
"8"
]
}
]
任何幫助表示感謝,提前致謝。
你有什麼這麼遠嗎?請張貼你已經試圖解決它的代碼。 –
你只需要格式化它的權利? –
是的Praveen,但這些是我動態獲得,以防萬一我可以有10組相同的密鑰,我需要合併它 – ManoharSingh