Page 1 of 1

Visual PHP Arrays

Posted: Wed Apr 07, 2010 3:19 pm
by phaedo5
I program in PHP daily. I often have to mess with very large, very nested arrays. I was wondering what you guys use to see large arrays other than <pre> tags and print_r. I've seen a couple of classes that organize them a little, but nothing has blown me away. I guess I'm hoping to hear someone way, YEAH! there's this thing in Firebug or something like that.

So really just curious if anyone has any tips.

Re: Visual PHP Arrays

Posted: Wed Apr 07, 2010 3:40 pm
by flying_circus
I'm not sure how firebug will allow you to view PHP arrays.

I use NuSphere PhpEd to develop. It has a built in debugger, which uses dbg. I can stop the script at runtime and any declared variables are shown in the debugger console. Arrays are represented as a familiar expandable/collapsible tree structure.

Re: Visual PHP Arrays

Posted: Wed Apr 07, 2010 3:59 pm
by AbraCadaver
phaedo5 wrote:I program in PHP daily. I often have to mess with very large, very nested arrays. I was wondering what you guys use to see large arrays other than <pre> tags and print_r. I've seen a couple of classes that organize them a little, but nothing has blown me away. I guess I'm hoping to hear someone way, YEAH! there's this thing in Firebug or something like that.

So really just curious if anyone has any tips.
Takes a little PHP work but integrates with Firebug for Firefox: http://www.firephp.org/HQ/Learn.htm

Re: Visual PHP Arrays

Posted: Wed Apr 07, 2010 4:51 pm
by Weirdan
AbraCadaver wrote:Takes a little PHP work but integrates with Firebug for Firefox: http://www.firephp.org/HQ/Learn.htm
+1 for FirePHP. We use it for about 1.5 years where I work, and it's a real savior. The only problem is that it's for Firefox only.

Re: Visual PHP Arrays

Posted: Wed Apr 07, 2010 5:28 pm
by minorDemocritus
var_dump() is a bit easier than <pre> tags. I'm not sure how good it is for nested arrays, through.

Re: Visual PHP Arrays

Posted: Thu Apr 08, 2010 10:42 am
by phaedo5
Awesome. Thanks for the response guys. I'm going to give this FirePHP a shot. That sounds great!