//PHP优雅的输出数组
echo "<pre>";print_r($arr);echo "<pre>";


print_r($arr);
/*
Array
(
    [1] => 1
    [2] => 3
    [3] => 5
    [4] => Cls1 Object
        (
            [var1] => 111
            [var2:protected] => 222
            [var3:Cls1:private] => 333
        )
)
*/

var_dump($arr);
/*
array(4) {
  [1]=>
  int(1)
  [2]=>
  string(1) "3"
  [3]=>
  int(5)
  [4]=>
  object(Cls1)#1 (3) {
    ["var1"]=>
    int(111)
    ["var2":protected]=>
    int(222)
    ["var3":"Cls1":private]=>
    int(333)
  }
}

Last modification:February 23, 2020
如果觉得我的文章对你有用,请随意赞赏