fefas / jsoncoder
Json encoder and decoder as a class
Installs: 1 397
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.2
Requires (Dev)
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2024-10-23 11:29:44 UTC
README
Jsoncoder
Jsoncode is the result of I claiming by a way to encode, decode and whatever JSON using classes with error handling intead of awful functions.
Installation
Install it using Composer:
$ composer require fefas/jsoncoder
Usage
<?php use Fefas\Jsoncoder\Json; $json1 = Json::createFromString('{"field":"value"}'); // from a json string $json2 = Json::create(['field' => 'anotherValue']); // from PHP values echo $json1; // {"field":"value"} echo $json2; // {"field":"anotherValue"} $json1->decode(); // ['field' => 'value'] $json2->decode(); // ['field' => 'anotherValue'] $json1->isEqualTo($json2); // false