Answer the question
In order to leave comments, you need to log in
How to make JSON readable?
There is a json file. It is updated from time to time by means of php. But also this file is often edited manually. But here's the trouble, after encoding to json through php, it becomes one line.
Is there a php class that turns this string into a human readable form?
For example
{
"foo":["bar","baz"],
"key":true
}
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/function.json-encode.php See
options -> JSON_PRETTY_PRINTjson_encode($a, JSON_PRETTY_PRINT);
in addition to the mentioned autoformat in the id: chris.photobooks.com/json/default.htm Jason's eye-pleasing painter, recognizes tables (when an array of objects with the same fields)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question