How do I dump arrays in a nice orderly fashion?
- by George
Whenever I use print_r or var_dump they come out all sloppy and in one line instead of formatted like I see so many people and the actual php.net site being able to achieve. What do I do to get them like this -
Array
(
[a] => apple
[b] => banana
[c] => Array
(
[0] => x
[1] => y
[2] => z
)
)
Instead of this
Array([a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ))
(Pretty sure it comes out even messier than that I was just deleting whitespace by hand.)