class Json

Methods

static string
encode(mixed $data, int $flags = JSON_UNESCAPED_UNICODE, int $depth = 512)

Encode a value to JSON.

static mixed
decode(string $json, bool $assoc = true, int $depth = 512, int $flags = 0)

Decode a JSON string.

Details

at line 18
static string encode(mixed $data, int $flags = JSON_UNESCAPED_UNICODE, int $depth = 512)

Encode a value to JSON.

Parameters

mixed $data
int $flags
int $depth

Return Value

string

Exceptions

JsonException

at line 36
static mixed decode(string $json, bool $assoc = true, int $depth = 512, int $flags = 0)

Decode a JSON string.

Parameters

string $json
bool $assoc
int $depth
int $flags

Return Value

mixed

Exceptions

JsonException