PHPackages                             evandarwin/jsend - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. evandarwin/jsend

ActiveProject[Parsing &amp; Serialization](/categories/parsing)

evandarwin/jsend
================

Basic JSend interface for PHP projects.

2.0.1(6y ago)115.7k↑292.9%1MITPHPPHP &gt;=7.2.0

Since Mar 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/EvanDarwin/JSend)[ Packagist](https://packagist.org/packages/evandarwin/jsend)[ RSS](/packages/evandarwin-jsend/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (11)Used By (1)

JSend
=====

[](#jsend)

[![Build Status](https://camo.githubusercontent.com/5eaf345298d504bf505e4e578577918ef56e12101afc7a1ed128653f81ffa8e1/68747470733a2f2f7472617669732d63692e6f72672f4576616e44617277696e2f4a53656e642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/EvanDarwin/JSend)[![Code Climate](https://camo.githubusercontent.com/337fb5025fd476f13372cae815ae30083340b6e3bd7b9f69b54da0200c1db616/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4576616e44617277696e2f4a53656e642f6261646765732f6770612e737667)](https://codeclimate.com/github/EvanDarwin/JSend)[![Test Coverage](https://camo.githubusercontent.com/350b37512e8d004296fafc14edd0ba2618946833f0f544ee38f464cb6b32b535/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4576616e44617277696e2f4a53656e642f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/EvanDarwin/JSend)

A tiny PHP library that generates JSON responses based on the original [JSend specification](http://labs.omniti.com/labs/jsend).

The specification has been slightly modified to make use for APIs, in which the are now optional `code` and `message` attributes. Both are meant to be human readable, and will not show up if not supplied.

> **Version 2.x requires PHP 7.2+**If you need support for PHP &gt;= 5.6, use the 1.x branch.

Installation
------------

[](#installation)

Install JSend via Composer:

```
$ composer require evandarwin/jsend
```

Usage
-----

[](#usage)

You can use JSend like so:

```
