Making PHP var_dump() values display one line per value

前端 未结 14 1227
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 15:41

When I echo var_dump($_variable), I get one long, wrapping line with all varable\'s and values like

[\"kt_login_user\"]=>  string(8) \"teacher1\" [\"kt_lo         


        
14条回答
  •  醉梦人生
    2020-12-23 16:25

    Personally I like the replacement function provided by Symfony's var dumper component

    Install with composer require symfony/var-dumper and just use dump($var)

    It takes care of the rest. I believe there's also a bit of JS injected there to allow you to interact with the output a bit.

提交回复
热议问题