swaggest/json

JSON encoder with RAW support

v1.0.0 2017-11-23 05:51 UTC

This package is auto-updated.

Last update: 2021-11-17 19:32:03 UTC


README

JSON encoder with RAW support

Build Status Scrutinizer Code Quality Code Climate

Installation

composer require swaggest/json

Usage

$data = array(
    'val' => 'hello!',
    'callback' => new \Swaggest\Json\RawJson('function(){alert("hello!")}')
);

$json = (string)(new \Swaggest\Json\Json($data));
$this->assertSame('{"val":"hello!","callback":function(){alert(\"hello!\")}}', $json);