You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usephp\io\Stream;
usephp\format\JsonProcessor;
// Create json processor.$processor = newJsonProcessor(JsonProcessor::DESERIALIZE_AS_ARRAYS | JsonProcessor::SERIALIZE_PRETTY_PRINT);
// Parse json string, like json_decode().$point = $processor->parse('{"x": 100, "y": 200}');
// Format to json string, like json_encode().echo$processor->format($point);
// Alse, you can format to php\io\Stream$processor->formatTo($point, Stream::of('path/to/file.json', 'w+'));
If you want to use the classic php way, you should include jphp-zend extension.