PHPackages                             alexistm/simple-json-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alexistm/simple-json-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alexistm/simple-json-php
========================

Simple JSON for PHP makes you able to construct JSON and send the headers easily. The main purposes are speed and ease to use.

5.1.0(6y ago)4523237MITPHPPHP &gt;=5.3.0

Since Apr 4Pushed 5y ago4 watchersCompare

[ Source](https://github.com/AlexisTM/Simple-Json-PHP)[ Packagist](https://packagist.org/packages/alexistm/simple-json-php)[ RSS](/packages/alexistm-simple-json-php/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Simple JSON for PHP [![Build Status](https://camo.githubusercontent.com/d49180adff417429c0dece263f8bdb9ccd3c85f3d90334ace83645a6a5732e26/68747470733a2f2f7472617669732d63692e6f72672f416c65786973544d2f53696d706c652d4a736f6e2d5048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AlexisTM/Simple-Json-PHP)
===========================================================================================================================================================================================================================================================================================================================

[](#simple-json-for-php--)

Introduction
------------

[](#introduction)

Simple JSON for PHP simplify the `json_encode` function. Instead of creating a Stdclass and then json\_encode it, send, headers and echo the json, you can simply create the object and use `$json->send();`.

Pros:

- Easy: As simple as a Stdclass, bundled functions.
- Fast: JSON are encoded with the native json\_encode()
- Reliable: Headers are sent automatically
- Complete: You can add objects, properties or arrays
- Callback/Variable or simply a JSON option
- JSONP compatible
- JQuery compatible

Cons:

- Optimized for objects because JSON is an object notation.

Usage
-----

[](#usage)

```
