json

Contains functions for working with the json format

Functions

jsondecode(data) - converts data to json string

Example

use "json"

print jsondecode("{\"key1\":1,\"key2\":[1,2,3],\"key3\":\"text\"}") // {key2=[1, 2, 3], key3=text, key1=1}

jsonencode(jsonString) - converts string to data

Example

use "json"

data = {
  "key1": 1,
  "key2": [1, 2, 3],
  "key3": "text"
}
print jsonencode(data) // {"key1":1,"key2":[1,2,3],"key3":"text"}

results matching ""

    No results matching ""