Json
Table of Contents
Constants
- DEFAULT_OPTIONS = JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE
Methods
- decode() : mixed
- Takes a JSON encoded string and converts it into a PHP variable.
- encode() : mixed
- Returns a string containing the JSON representation of $data.
Constants
DEFAULT_OPTIONS
public
mixed
DEFAULT_OPTIONS
= JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE
Methods
decode()
Takes a JSON encoded string and converts it into a PHP variable.
public
static decode(string $data) : mixed
Parameters
- $data : string
-
The json string being decoded.
Tags
encode()
Returns a string containing the JSON representation of $data.
public
static encode(mixed $data[, int|null $options = null ]) : mixed
Parameters
- $data : mixed
-
The value being encoded.
- $options : int|null = null
-
Bitmasked options. Default is JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE.