decodes a JSON string into appropriate variable
mixed
decode
(string $str)
-
string
$str: JSON-formatted string
encodes an arbitrary variable into JSON format
mixed
encode
(mixed $var)
-
mixed
$var: any number, boolean, string, array, or object to be encoded. if var is a string, note that encode() always expects it to be in ASCII or UTF-8 format!
constructs a new JSON instance
void
jJSON
(int $use)
-
int
$use: object behavior flags; combine with boolean-OR possible values:
- SERVICES_JSON_STRICT_TYPE: (default) strict
convertion
- SERVICES_JSON_LOOSE_TYPE: loose typing.
"{...}" syntax creates associative arrays
instead of objects in decode().