class Json

JSON encoder and decoder.

Traits

Static class.

Constants

FORCE_ARRAY

PRETTY

Methods

static string
encode($value, int $flags = 0)

Returns the JSON representation of a value. Accepts flag Json::PRETTY.

static mixed
decode(string $json, int $flags = 0)

Decodes a JSON string. Accepts flag Json::FORCE_ARRAY.

Details

at line 30
static string encode($value, int $flags = 0)

Returns the JSON representation of a value. Accepts flag Json::PRETTY.

Parameters

$value
int $flags

Return Value

string

at line 48
static mixed decode(string $json, int $flags = 0)

Decodes a JSON string. Accepts flag Json::FORCE_ARRAY.

Parameters

string $json
int $flags

Return Value

mixed