Repository navigation
JSON
Denotes a JSON nested data structure, headed by the given top structure (should be JsonMap(...), JsonList(...) or JsonArray(array)). This represents an actual data structure ID and should be the final value stored in variables.
my_json = JsonData(
JsonMap(
"a", 5,
"b", 7
)
);
show_debug_message(json_encode(my_json)); //{"a": 5, "b": 7}
Convert the array and all nested arrays into JSON arrays. 1D arrays are converted into simple JSON arrays, 2D arrays are converted into 2-level JSON arrays in row-major order. Use this only within JsonData(...), JsonList(...) or JsonMap(...). Do not nest JsonData(...), JsonList(...) or JsonMap(...) within the array being converted.
hiscore_array = Array(992, 581, 317, 226, 102);
hiscore_data = JsonData(
JsonMap(
"last_updated", "2017-09-07 14:14:14",
"data", JsonArray(hiscore_array)
)
);
Denotes a JSON array with the given key-value pairs. Use this only within JsonData(...), JsonList(...) or JsonMap(...).
hiscore_data = JsonData(
JsonMap(
"last_updated", "2017-09-07 14:14:14",
"data", JsonList(
992, 581, 317, 226, 102
)
)
);
Denotes a JSON object with the given key-value pairs. Use this only within JsonData(...), JsonList(...) or JsonMap(...).
player = JsonData(
JsonMap(
"name", "Alice Anderson",
"age", 32
)
);