Make var_dump look pretty

后端 未结 14 2518
忘掉有多难
忘掉有多难 2020-12-02 04:23

I have a simple $_GET[] query var set for showing testing data when pulling down queries from the DB.


  <         


        
14条回答
  •  广开言路
    2020-12-02 04:40

    I really love var_export(). If you like copy/paste-able code, try:

    echo '
    ' . var_export($data, true) . '
    ';

    Or even something like this for color syntax highlighting:

    highlight_string("");
    

    You can do the same with print_r(). For var_dump() you would just need to add the

     tags:

    echo '
    ';
    var_dump($data);
    echo '
    ';

提交回复
热议问题