I have the following JSON array:
[
{"id": "01", "state": "Alabama", "category": "Coal", "detail1": null, "detail2": null},
{"id": "02", "state": "Alaska", "category": null, "detail1": null, "detail2": null},
{"id": "04", "state": "Arizona", "category": "Oil", "detail1": null, "detail2": null}
]
That I need to turn into this:
{
"01": { "state":"Alabama", "category":"A", "detail1":"Status 1", "detail2":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "},
"02": { "state":"Alaska", "category":"B", "detail1":"Status2", "detail2":"Integer egestas fermentum neque vitae mattis. "},
"04": { "state":"Arizona", "category":"C", "detail1":"Status 3", "detail2":"Fusce hendrerit ac enim a consequat. "}
}
But I can't figure out how. Can anyone help?