Constants
Output modes
Every data-returning method accepts an optional $output argument.
| Constant | Value | Returns |
|---|---|---|
JsonFast::OUTPUT_ARRAY | 0 | PHP array (default) |
JsonFast::OUTPUT_STRING | 1 | JSON string |
JsonFast::OUTPUT_OBJECT | 2 | stdClass for JSON objects |
php
$data = JsonFast::minify($json); // array
$string = JsonFast::minify($json, JsonFast::OUTPUT_STRING); // string
$object = JsonFast::minify($json, JsonFast::OUTPUT_OBJECT); // stdClassTIP
OUTPUT_OBJECT only affects JSON objects. JSON arrays are always returned as PHP arrays.