Sorting url data to table

Hey!

How i could sort this url data http://futuretechs.eu/server/users.php
to table like:

Server.Users[ 1 ]

would return me all of the data of the user that is the first?

I dont know how i would make it possible.

Thank you.

[LUA]
local users = {}
for user_str in users_result:gmatch("%b{}") do
local user = {}
for key, val in user_str:gmatch("%[’(.-)’%]=(.-),") do
user[key] = tonumber(val) and tonumber(val) or val
end
users[#users + 1] = user
end
[/LUA]

That should work

The above code would sort the table from text, if you don’t know how to get the text from the web file and onto lua, you can use

http.Fetch

you could use json_encode( array ) in the php file and then use util.JSONToTable( string ) in lua inside the http.Fetch callback

Sadly, that is not an option. I have multiple arrays that i made to 1.

[editline]18th February 2015[/editline]

print( users[1] ) does not work?