swaggest/json

JSON encoder with RAW support

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

This package is auto-updated.

Last update: 2024-10-18 02:27:28 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);