Hi,
now the CJSON::encode-function encode an associative array to a json-object.
i read the comments in the code and understand why this way was choosen.
But i think it would be better to create an array of objects with key and value as properties.
For example the following array
will be encoded to this:
I think it would be clearer (and in my opinion better to use) if it look more like this:
What do you think?
Greetings from Germany
me23
now the CJSON::encode-function encode an associative array to a json-object.
i read the comments in the code and understand why this way was choosen.
But i think it would be better to create an array of objects with key and value as properties.
For example the following array
CJSON::encode (
array(
81523=>"87080",
81528=>"87082",
81533=>"87084",
)
);
will be encoded to this:
{"81523":"87080","81528":"87082","81533":"87084"}
I think it would be clearer (and in my opinion better to use) if it look more like this:
[
{"key":"81523", "value":"87080"},
{"key":"81528", "value":"87082"},
{"key":"81533", "value":"87084"},
]
What do you think?
Greetings from Germany
me23