class Json (View source)

Methods

mixed
decode(string $string, bool $assoc = false)

Decodes a JSON string into a php variable.

string
encode(mixed $mixed)

Encodes a data structure into a JSON string.

Details

mixed decode(string $string, bool $assoc = false)

Decodes a JSON string into a php variable.

Parameters

string $string
bool $assoc

[default: false] When true, returned objects will be converted into associative arrays, when false they'll be converted into stdClass instances.

Return Value

mixed

string encode(mixed $mixed)

Encodes a data structure into a JSON string.

Parameters

mixed $mixed

Return Value

string