How to print Array READABLE

2019-08-05 16:31发布

How do i print an Array readable? print_r($array); and var_dump($array); both produce some very ugly clutter of that $array. Ok it is what it says, it prints that array, but i'd like to have some well formated print of that array, how do i do that?

7条回答
姐就是有狂的资本
2楼-- · 2019-08-05 17:12
echo '<pre>';
var_dump($array);
echo '</pre>';

Or to a better yet performance, use xDebug with html_colors = on. html_colors can be found on php.ini file. xdebug is from http://xdebug.org/download.php

With xDebug and Colors you don't need to use

echo '<pre>';
echo '</pre>';

it's beautiful as-is.

查看更多
登录 后发表回答