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>

Tags

Add new comment

Markdown

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Missing filter. All text is removed