Today there is a requirement to format the output JSON
The first thing that comes to mind is a small plug-in such as jsBeautifier
After searching for a while, I saw a friend answered that JSON.stringify can output formatted JSON strings
JSON.stringify(jsObj, null, "t"); // Indent one tab
JSON.stringify(jsObj, null, 4); // Indent 4 spaces
Hmm, not bad
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn