Json
final class Json
JSON encoder and decoder.
Constants
FORCE_ARRAY |
|
PRETTY |
|
ESCAPE_UNICODE |
|
Methods
static string
encode(mixed $value, bool|int $pretty = false, bool $escapeUnicode = false)
Converts value to JSON format. Use $pretty for easier reading and clarity and $escapeUnicode for ASCII output.
static mixed
decode(string $json, bool|int $forceArray = false)
Parses JSON to PHP value. Parameter $forceArray forces an array instead of an object as the return value.
Details
at line 31
static string
encode(mixed $value, bool|int $pretty = false, bool $escapeUnicode = false)
Converts value to JSON format. Use $pretty for easier reading and clarity and $escapeUnicode for ASCII output.
at line 61
static mixed
decode(string $json, bool|int $forceArray = false)
Parses JSON to PHP value. Parameter $forceArray forces an array instead of an object as the return value.
Traits
Static class.