I used json.encode to write a numerically indexed array to storage.
The values in the array are numbers too.
json gives me this kind of thing:
{“1”:442,“2”:394,“3”:429,…
The trouble comes when I read it back.
The documentation says that numerically indexed array should be recovered as such, but what I get back is a set of string pairs
newArray[“1”] contains “442”
and this means I can’t access element [2], its [“2”]
================
I have worked around it by using a loop containing
realArray[x] = pairsArrayfromJson[tostring(x)] *1
but yeuch…
How does anyone else save and load a simple numerically index array ?
[import]uid: 108660 topic_id: 23140 reply_id: 323140[/import]