Skip to main content

Arguments

string
required
JSON string ที่จะ parse. function อ่าน argument นี้ด้วย string type checking.
DecodeOptions
Optional decode options. boolean ตั้งค่า useNull. table ตั้งค่า useNull และ maxDepth ได้.

Returns

any
Decoded value. JSON objects และ arrays กลายเป็น tables พร้อม JSON type markers, strings กลายเป็น Lua strings, numbers กลายเป็น Lua numbers, booleans กลายเป็น booleans, และ null กลายเป็น json.null เว้นแต่ useNull เป็น false.

Types

DecodeOptions

ควบคุมพฤติกรรมการแยกวิเคราะห์ JSON

ตัวอย่าง

Parse JSON ด้วย function เดียวกับที่ json.decode ใช้.