If you visit this blog on a regular basis, it’s likely that you know about the PHP Array and Object Beautifier. Many times while debugging PHP, I’ve been in tough spots, forced to use print_r’s and I simply could not read them. var_dump’s are good when you don’t mind sifting Source Code. var_export’s are handy too. But sometimes you get stuck. Maybe habit slips in. Therefore a print_r is what you got.
I made this utility. It was a simple iterative script that looked for parenthesis and brackets. You can find it here on GitHub. But that wasn’t good enough. Finally I decided to strip it down and make something a little more practical, easier to read, more useful.
Introducing the PHP Array Beautifier v3.
New Features
- Convert to Object Script – The script will actually read and interpret your data object. Soon, I will expand to classed objects too
- Clean Print of Data after Object Encoding – Prints out the data from a pre-built array from a print_r() statement
- Expand and Collapse – Narrow down your results if there is simply too much data
- Serialized Object – Take your data and re-serialize it for use in your application or for additional testing
- Route Display – How do I access this leaf array node, just click the ® button
So, enjoy. You can click any of the images to view the tool, or just access it here.