函数名

jsonLib.encode(table)

函数介绍

方法名称:把lua表格编码成json字符串

参数说明:
table:lua表格


返回值:json字符串

函数例子

local tb={
   code = 1,
   data = {
       ret = "hello ok",
       status = 123
   }
}
print(jsonLib.encode(tb))      ----输出:{"code":1,"data":{"status":123,"ret":"hello ok"}}