| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
use php\io\Stream;
use php\format\JsonProcessor;
// Create json processor.
$processor = new JsonProcessor(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);
// Also, 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.
JPHP Group 2015
| Back | FazBrowse Home | New Git URL |