Pretty-Printing JSON with PHP

后端 未结 24 2124
一向
一向 2020-11-22 02:03

I\'m building a PHP script that feeds JSON data to another script. My script builds data into a large associative array, and then outputs the data using json_encode

24条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 03:08

    I had the same issue.

    Anyway I just used the json formatting code here:

    http://recursive-design.com/blog/2008/03/11/format-json-with-php/

    Works well for what I needed it for.

    And a more maintained version: https://github.com/GerHobbelt/nicejson-php

提交回复
热议问题