Json
final class Json
JSON encoder and decoder.
Constants
deprecated FORCE_ARRAY |
|
deprecated PRETTY |
|
deprecated ESCAPE_UNICODE |
|
Methods
static string
encode(mixed $value, bool|int $pretty = false, bool $asciiSafe = false, bool $htmlSafe = false, bool $forceObjects = false)
Converts value to JSON format. Use $pretty for easier reading and clarity, $asciiSafe for ASCII output and $htmlSafe for HTML escaping, $forceObjects enforces the encoding of non-associateve arrays as objects.
static mixed
decode(string $json, bool|int $forceArrays = false)
Parses JSON to PHP value. The $forceArrays enforces the decoding of objects as arrays.
Details
at line 37
static string
encode(mixed $value, bool|int $pretty = false, bool $asciiSafe = false, bool $htmlSafe = false, bool $forceObjects = false)
Converts value to JSON format. Use $pretty for easier reading and clarity, $asciiSafe for ASCII output and $htmlSafe for HTML escaping, $forceObjects enforces the encoding of non-associateve arrays as objects.
at line 70
static mixed
decode(string $json, bool|int $forceArrays = false)
Parses JSON to PHP value. The $forceArrays enforces the decoding of objects as arrays.
Traits
Static class.