Download the PHP package webfiori/jsonx without Composer
On this page you can find all versions of the php package webfiori/jsonx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jsonx
WebFiori Json
A helper class library for creating JSON or JSONx strings in PHP. It can be used to create well-formatted json strings from any variable type (strings, numbers, boolean arrays and even objects).
Content
- What is JSON?
- Features
- Supported PHP Versions
- Installation
- Code Samples
- Basic Usage
- Example
- Converting Properties Case
- Reading From Files
- Working With Objects
- Decoding JSON String
- Storing Output
- Working With Arrays
- [JSONx](#jsonx]
What is JSON?
According to json.org, JSON is a data exchange format which is based partially on JavaScript. It is easy for humans to read and for machines to understand. JSON data is represented as pairs of keys and values.
Features
- Support fo creating well formatted JSON.
- Support for creating JSONx.
- Ability to decode JSON strings and convert them to
Json
objects. - Ability to read JSON files and map JSON values to PHP data types.
- Ability to manipulate JSON properties as needed.
Supported PHP Versions
Build Status |
---|
Installation
If you are using composer to manage your dependencies, then it is possible to install the library by including the entry "webfiori/jsonx":"*"
in the require
section of your composer.json
file to install the latest release.
Another way to include the library is by going to releases and download the latest release and extract compressed file content and add them to your include directory.
Basic Usage
The process of using the classes is very simple. What you have to do is the following steps:
- Import (or include) the class
Json
. - Create an instance of the class.
- Add data as needed.
- Output the object using
echo
command or any similar one.
For more information and advanced use cases, check here.
Example
The following code shows a very simple usage example.
Following example shows how data can be added directly using the constructure.
The JSON output of this code will be the following: