Making PHP var_dump() values display one line per value

前端 未结 14 1289
隐瞒了意图╮
隐瞒了意图╮ 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:38

    Use output buffers: http://php.net/manual/de/function.ob-start.php

     $dump 
    "; ?>

    Yet another option would be to use Output buffering and convert all the newlines in the dump to
    elements, e.g.

    ob_start();
    var_dump($_SERVER) ;
    echo nl2br(ob_get_clean());
    

提交回复
热议问题