swaggest / json
JSON encoder with RAW support
Installs: 1 808
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ^4.0
This package is auto-updated.
Last update: 2024-11-18 02:40:19 UTC
README
JSON encoder with RAW support
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);