DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Print Array In Readable Format

02.22.2006
| 46272 views |
  • submit to reddit
        // description of your code here

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

Comments

Snippets Manager replied on Wed, 2006/08/02 - 11:38am

nicer still: var_dump ( $array ) ;

Snippets Manager replied on Tue, 2006/02/28 - 4:23am

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 );

Snippets Manager replied on Thu, 2006/02/09 - 1:52pm

hi! please don't post the same message more than one time ^_^