JSON Decode | DECODE_JSON

Syntax

DECODE_JSON( [value] )

Parameters

value
A JSON encoded TEXT value to decode.

Return Value

The decoded value. If the value is not a valid JSON encoded TEXT value, NULL is returned.

Description

Decode a TEXT value as JSON.

Examples

DECODE_JSON("\"some text\"") # returns "some text"
DECODE_JSON("null") # returns NULL
DECODE_JSON("[1, 2, 3]") # returns [1, 2, 3]
DECODE_JSON("{\"a\": 1, \"b\": 2}") # returns ["a" => 1, "b" => 2]