The php function json_encode () has the ability to indent json output for a "pretty" version. This option is called: JSON_PRETTY_PRINT
A slight pet complaint is that this function uses 4 spaces in the specified indent.
Is it possible to use 2 spaces instead of 4 or an efficient way to process the output to reduce 4 spaces to 2 - without violating any of the json keys / values that may have spaces in them.
source share