A better print_r: dBug

Posted in PHP at 7:38 pm by Madarco

dBug is a php library that print a nice-formatted dump of a variable:

PHP:
  1. include_once("dBug.php");
  2.  
  3. $variable = array(
  4.     "first"=>"1",
  5.     "second",
  6.     "third"=>array(
  7.         "inner third 1",
  8.         "inner third 2"=>"yeah"),
  9.     "fourth");
  10.  
  11. new dBug($variable);

Will be formatted like this:
dBug

Variable types supported are: Arrays, Objects, Recordsets and XML Resources.

Leave a Reply

Antispam: