Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $str1=
- {"id":"1","name":"அடகு","tooltip":" ","color":" ","children":[{"id":"2","name":"கொதுவை ","parent":"1","tooltip":" ","color":"#FF0000"},{"id":"3","name":"அடைமானம் ","parent":"1","tooltip":" ","color":"#FF0000"},{"id":"4","name":"பிணையம் ","parent":"1","tooltip":" ","color":"#FF0000"},{"id":"5","name":"ஈடு ","parent":"1","tooltip":" ","color":"#FF0000"},{"id":"6","name":"ஒற்றி ","parent":"1","tooltip":" ","color":"#FF0000"},{"id":"9","name":"கீரைக்கறி ","parent":"1","tooltip":" ","color":"#1E90FF"}]}
- $str2=
- //1st set
- {"id":"1","name":"குழைவு","tooltip":" ","color":" ","children":[{"id":"2","name":"நெகிழ்கை ","parent":"1","tooltip":" ","color":"#FF0000 "},{"id":"6","name":"அணைவு ","parent":"1","tooltip":" ","color":"#8A2BE2 "},{"id":"7","name":"வளைவு ","parent":"1","tooltip":" ","color":"#0000FF "}]}
- //2nd set
- {"id":"1","name":"ஈடு","tooltip":" ","color":" ","children":[{"id":"2","name":"இடு ","parent":"1","tooltip":" ","color":"#FF0000 "},{"id":"14","name":"பொருத்தம் ","parent":"1","tooltip":" ","color":"#8A2BE2 "},{"id":"18","name":"குழைவு ","parent":"1","tooltip":" ","color":"#008B00 "}]}
- //3rd set
- {"id":"1","name":"அடைமானம்","tooltip":" ","color":" ","children":[{"id":"2","name":"கொதுவை ","parent":"1","tooltip":" ","color":"#FF0000 "},{"id":"3","name":"ஈடு ","parent":"1","tooltip":" ","color":"#FF0000 "},{"id":"4","name":"அடகு ","parent":"1","tooltip":" ","color":"#FF0000 "}]}
- Expected Output
- {
- "id":"1",
- "name":"அடகு",
- "tooltip":" ",
- "color":" ",
- "children":[
- {
- "id":"2",
- "name":"கொதுவை",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000"
- },
- {
- "id":"1",
- "name":"அடைமானம்",
- "tooltip":" ",
- "color":" ",
- "children":[
- {
- "id":"2",
- "name":"கொதுவை ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000 "
- },
- {
- "id":"1",
- "name":"ஈடு",
- "tooltip":" ",
- "color":" ",
- "children":[
- {
- "id":"2",
- "name":"இடு ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000 "
- },
- {
- "id":"1",
- "name":"குழைவு",
- "tooltip":" ",
- "color":" ",
- "children":[
- {
- "id":"2",
- "name":"நெகிழ்கை ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000 "
- },
- {
- "id":"6",
- "name":"அணைவு ",
- "parent":"1",
- "tooltip":" ",
- "color":"#8A2BE2 "
- },
- {
- "id":"7",
- "name":"வளைவு ",
- "parent":"1",
- "tooltip":" ",
- "color":"#0000FF "
- }
- ]
- },
- {
- "id":"14",
- "name":"பொருத்தம் ",
- "parent":"1",
- "tooltip":" ",
- "color":"#8A2BE2 "
- },
- {
- "id":"18",
- "name":"குழைவு ",
- "parent":"1",
- "tooltip":" ",
- "color":"#008B00 "
- }
- ]
- },
- {
- "id":"4",
- "name":"அடகு ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000 "
- }
- ]
- },
- {
- "id":"4",
- "name":"பிணையம் ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000"
- },
- {
- "id":"6",
- "name":"ஒற்றி ",
- "parent":"1",
- "tooltip":" ",
- "color":"#FF0000"
- },
- {
- "id":"9",
- "name":"கீரைக்கறி ",
- "parent":"1",
- "tooltip":" ",
- "color":"#1E90FF"
- }
- ]
- }
Add Comment
Please, Sign In to add comment