goma / goma-json-lib
Goma JSON Lib provides Exception handling for JSON encode and decode. It has a workaround for non-utf8 values.
Installs: 1 538
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.0
- goma/goma-test-core: dev-master
This package is auto-updated.
Last update: 2024-04-15 22:25:38 UTC
README
Goma JSON Lib provides Exception handling for JSON encode and decode. It has a workaround for non-utf8 values.
Methods
- JSON::encode( mixed $value [[, int $options = 0 [, int $depth = 512 ]], bool $throwNonUtf8 = false]) - encodes data. If utf8 error is thrown, it tries a workaround. For every other kind of error JSONException is thrown.
- JSON::decode(string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]]) - decodes an json string. Throws JSONException in case of a problem.
JSONException
The code of the JSONException is the same as json_last_error(). Message is json_last_error_msg().