Commit 0d18d33c authored by Kevin Herrera's avatar Kevin Herrera

Create a readme.

parent abd3e666
[![Build Status](](
[![Packagist Pre Release](]()
A library for encoding, decoding, linting, and validating JSON data.
This library provides a simplified interface into existing functionality that
is provided by PHP's `json` extension, `justinrainbow/json-schema`, and also
`seld/jsonlint`. The purpose is to make it easy to use while making it hard
to miss errors.
$json = new JSON();
// Decode JSON values.
$decoded = $json->decode('{"test":123}');
// Decode JSON values in files.
$decoded = $json->decodeFile('/path/to/file.json');
// Encode native values.
$encoded = $json->encode(['test' => 123]);
// Encode native values into files.
$json->encodeFile(['test' => 123], '/path/to/file.json');
// Lint an encoded JSON value.
// Lint an encoded JSON value in a file.
// Validate a decoded JSON value using a JSON schema.
The [`JSONInterface`](src/KHerGe/JSON/JSONInterface.php) interface is your
best resource. The `JSON` class you will be using implements this interface
and contains all of the information you will need.
- PHP 5.6+
- json
composer require kherge/json=^2.0
This library is released under the MIT and Apache 2.0 licenses.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment