search

Home  >  Q&A  >  body text

php var_dump display problem

I use var_dump in php to print the values ​​taken out from the database. The format is like this

;
It looks very inconvenient. Is there any way to display it like an array?
Do not add this code echo'<pre>' when outputting ;

                 echo '</pre>';
                 就能显示成这样
                 

巴扎黑巴扎黑2763 days ago974

reply all(6)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-24 11:36:23

    Method 1: ctrl+u View source code

    Method 2: Install xdebug

    Method 3: Print with plug-ins such as Kint

    reply
    0
  • 黄舟

    黄舟2017-05-24 11:36:23

    print_r()
    Press F12 to see

    reply
    0
  • PHPz

    PHPz2017-05-24 11:36:23

    echo print_r($arr,true);

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-24 11:36:23

    1 The browser directly installs the jsonview plug-in.
    2 Install the jq.plugin in the terminal
    Use echo json_encode($val) when outputting
    It looks very nice.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-24 11:36:23

    View the source code
    Customize the output function in the editor

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-24 11:36:23

    You can install an xdebug

    reply
    0
  • Cancelreply