I need to write a JSON string that will be interpreted as an array, but only certain indexes will actually have any values.
I would like an array that looks like this:
array[1] = ["foo", "bar"]
array[5] = ["things", "stuff"]
array[37] = ["etc"];
So that to return “stuff” I could call array[5][1].
The catch is that not everything will have values, and I’m writing this string by hand, so I don’t really want to start from 0 and do all the empty values. Is there an easy way to do this?
JSON representation of your data structure…
or just…