Display an array in a readable/hierarchical format

后端 未结 18 1238
北荒
北荒 2020-12-02 04:53

Here is the code for pulling the data for my array



        
18条回答
  •  悲&欢浪女
    2020-12-02 05:31

    One-liner for a quick-and-easy JSON representation:

        echo json_encode($data, JSON_PRETTY_PRINT);
    

    If using composer for the project already, require symfony/yaml and:

        echo Yaml::dump($data);
    

提交回复
热议问题