Download the PHP package eugene-melbourne/json-encoder-decoder without Composer
On this page you can find all versions of the php package eugene-melbourne/json-encoder-decoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download eugene-melbourne/json-encoder-decoder
More information about eugene-melbourne/json-encoder-decoder
Files in eugene-melbourne/json-encoder-decoder
Download eugene-melbourne/json-encoder-decoder
More information about eugene-melbourne/json-encoder-decoder
Files in eugene-melbourne/json-encoder-decoder
Vendor eugene-melbourne
Package json-encoder-decoder
Short Description Encodes and Decodes JSON strings
License MIT
Package json-encoder-decoder
Short Description Encodes and Decodes JSON strings
License MIT
Please rate this library. Is it a good library?
Informations about the package json-encoder-decoder
JsonEncoderDecoder
Encodes and Decodes JSON strings
Installation
$ composer require eugene-melbourne/json-encoder-decoder
Most importantly it has default parameters pre-set
- JSON_THROW_ON_ERROR
- convertEmptyStringToNull
- ReturnAsAssociative
It can be changed though.
Also, it can ConvertEmptyStringToNull and has unit tests to see it in action.
Example:
// Example 1
$val = (new JsonEncoderDecoder())->json_encode(null)
// $val = null
// Example 2
$val = [chr(160),];
$json = (new JsonEncoderDecoder())->json_encode($val);
// throws JsonException
// Example 3
$val = [chr(160),];
$json = (new JsonEncoderDecoder())
->addOption(JSON_INVALID_UTF8_SUBSTITUTE)
->json_encode($val);
// $json = '["\ufffd"]';
See more examples in unit tests.
P.S.
The char code 160
would be
All versions of json-encoder-decoder with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
composer-runtime-api Version ^2.0
composer-runtime-api Version ^2.0
The package eugene-melbourne/json-encoder-decoder contains the following files
Loading the files please wait ....