Version: alpha
FUNCTION | |
---|---|
json.decode() | decode JSON from a string to a lua-table |
json.decode(json)
PARAMETERS
json |
json data |
RETURNS
data |
decoded json |
EXAMPLES
Converting a string containing JSON data into a Lua table:function init(self) local jsonstring = '{"persons":[{"name":"John Doe"},{"name":"Darth Vader"}]}' local data = json.decode(jsonstring) pprint(data) end
{ persons = { 1 = { name = John Doe, } 2 = { name = Darth Vader, } } }