JsonFormatter
in package
Formats json strings used for php < 5.4 because the json_encode doesn't supports the flags JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE in these versions
Tags
Table of Contents
- format() : string
- This code is based on the function found at: http://recursive-design.com/blog/2008/03/11/format-json-with-php/
Methods
format()
This code is based on the function found at: http://recursive-design.com/blog/2008/03/11/format-json-with-php/
public
static format(string $json, bool $unescapeUnicode, bool $unescapeSlashes) : string
Originally licensed under MIT by Dave Perrett mail@recursive-design.com
Parameters
- $json : string
- $unescapeUnicode : bool
-
Un escape unicode
- $unescapeSlashes : bool
-
Un escape slashes