A Cleaner Gentler PHP Variable Dump

Sure. Some structures, like an object with member arrays, will have you in a straight-jacket long before you determine where a particular value falls within the structure and how you should construct a reference to it.

Next time, try this:


print('<pre>').print_r($myarray,1).('<pre>');

The results are astonishingly different...


<pre>
Array
(
[0] => Array
(
[0] => Array
(
[0] => apple
[1] => orange
[2] => banana
)

[1] => Array
(
[0] => apple
[1] => orange
[2] => banana
)

)

[1] => Array
(
[0] => apple
[1] => orange
[2] => banana
)

[2] => Array
(
[0] => Array
(
[0] => apple
[1] => orange
[2] => banana
)

[1] => Array
(
[0] => apple
[1] => orange
[2] => banana
)

)

)
</pre>

2 comments

by osinamea (not verified) on Fri, 2011-05-20 21:15

i tend to just view source or inspect element in firebug

by ayen on Sun, 2011-07-10 22:25

View php variables in source/firebug??

©2005-2017 Ayen Designs. Underlying theme by Kiwi Themes.