Echo a multidimensional array in PHP

后端 未结 9 1528
名媛妹妹
名媛妹妹 2020-11-27 07:24

I have a multidimensional array and I\'m trying to find out how to simply \"echo\" the elements of the array. The depth of the array is not known, so it could be deeply nest

相关标签:
9条回答
  • 2020-11-27 08:23
    <pre>
    <?php print_r ($array); ?>
    </pre>
    
    0 讨论(0)
  • 2020-11-27 08:23

    If you're outputting the data for debugging and development purposes, Krumo is great for producing easily readable output. Check out the example output.

    0 讨论(0)
  • 2020-11-27 08:24

    Recursion would be your answer typically, but an alternative would be to use references. See http://www.ideashower.com/our_solutions/create-a-parent-child-array-structure-in-one-pass/

    0 讨论(0)
提交回复
热议问题