Output (echo/print) everything from a PHP Array

后端 未结 9 890
無奈伤痛
無奈伤痛 2020-12-06 16:21

Is it possible to echo or print the entire contents of an array without specifying which part of the array?

The scenario: I am trying to echo everything from:

<
9条回答
  •  猫巷女王i
    2020-12-06 16:59

    Similar to karim's, but with print_r which has a much small output and I find is usually all you need:

    function PrintR($var) {
        echo '
    ';
        print_r($var);
        echo '
    '; }

提交回复
热议问题