how can i display json string from the php into corona simulator screen. ..?

for like example…

the php output…

{“player1”:[“1”,“Ian”,“200”],“player2”:[“2”,“Matrix”,“199”],“player3”:[“3”,"Princess ",“198”]}

i want to display the playername and playerscore in my corona screen…
like this


ian           200

matrix      199

princess   198


how can i do that? any help pls… :frowning:

:mellow: :frowning: :mellow: :frowning:

Have you looked at the json module, specifically json.decode … http://docs.coronalabs.com/api/library/json/decode.html

If you have the data in a string (or read it from a file into a string), then 

local json = require "json" local tbl = json.decode( encode ) -- you now have a lua table that represents the json data -- e.g. ... -- loop over all players foreach k,v in pairs(tbl) do -- loop over all entries in the player data foreach k2,v2 in pairs(v) do -- print/collect fields you need here end end

hord to get :frowning:

Have you looked at the json module, specifically json.decode … http://docs.coronalabs.com/api/library/json/decode.html

If you have the data in a string (or read it from a file into a string), then 

local json = require "json" local tbl = json.decode( encode ) -- you now have a lua table that represents the json data -- e.g. ... -- loop over all players foreach k,v in pairs(tbl) do -- loop over all entries in the player data foreach k2,v2 in pairs(v) do -- print/collect fields you need here end end

hord to get :frowning: