Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

print array in readable format (See related posts)

// description of your code here

print("<pre>".print_r($_POST,true)."</pre>");

Comments on this post

whitetiger posts on Feb 23, 2006 at 13:02
hi!
please don't post the same message more than one time ^_^
donwilson posts on Feb 28, 2006 at 03:24
A much better way of doing this...

Make a function:
function print_pre( $array )
{
if ( @is_array ( $array ) )
{
print "
\n";
print_r ( $array );
print "
\n";
}
}

Then call it when you need it:

print_pre( $my_array );
davedavis posts on Aug 02, 2006 at 11:41
nicer still:
var_dump ( $array ) ;

You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts