Skip to content

Instantly share code, notes, and snippets.

@ferminhg
Created December 3, 2014 08:19
Show Gist options
  • Select an option

  • Save ferminhg/ec11f273b2da11bed713 to your computer and use it in GitHub Desktop.

Select an option

Save ferminhg/ec11f273b2da11bed713 to your computer and use it in GitHub Desktop.
Corona SDK - Working with JSON
local json = require "json"
--Lua script:
local luaTable = {
["name1"] = "value1",
["name2"] = {1, false, true, 23.54, "a string"},
name3 = json.null
}
local jsonData = json.encode( luaTable )
print (jsonData)
local data = json.decode( jsonData )
print (data.name2[4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment