« PHP + ODBC (specifically Access) | ^ Main | Backbase Forums »


echo vs niceEcho

Since I’m in the PHP world tonight I figured I’d post one of my favorite custom functions I use in every PHP site I build.

function niceEcho($data){
 	print("
 
 <pre>" . print_r($data, true) . "</pre>
 
 ");
}

What does this do? It prints anything you give it in a nice, vertical layout for ease of reading. It is very simple and allows you to look into arrays (of any depth), objects, etc. I love this function. :-)

To see some sample output see this post. At the bottom of the post you’ll see a nice looking array. Enjoy!

Posted by John C. Bland II on March 9, 2006 11:41 PM |

TrackBack

TrackBack URL for this entry:
http://mt.katapultmedia.com/mt-tb.cgi/65

Post a comment