Can i improve “json_encode” results readability with <br> tags?
本问题已经有最佳答案,请猛点这里访问。
我只是将我的语句结果作为JSON对象进行重复。但是函数json_encode()将所有内容都放到一行中,如下所示:
1 | {"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3"0":{"username":"Olli"},"1":{"username":"Heiner"},"2":{"username":"Rolf"},"success":true,"rowcount":3} |
现在想象一个JSONObject有更多的条目。
有没有办法添加一些
签出
1 |
输出:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [ [ [ [ [ [ { "a":"b" } ] ] ] ] ] ] |
号
参考:http://php.net/json_encode