Anybody who works in CFML knows about cfdump, an indispensable tool for debugging any otherwise hidden values in your ColdFusion logic.

In php, you can use print_r() to dump out an array, but the result is far from reader-friendly. Enter "dBug.php". Get it here: dBug.php project home (If you use it be sure to make at least a small donation to the developer)

Just drop the downloaded dBug.php file into your site, then include it into your global functions or application settings file in any php site (or any php page) and you'll be off and running with dBug:

view plain print about
1require_once('dBug.php');

Once it is available in the page, you can dump out anything with dBug, including any variable, array, object, or even xml just like cfdump

view plain print about
1new dBug($_POST);
2new dBug($myArray);
3new dBug($myVariable);
4new dBug($xmlData, "xml");
5etc.

Depending on what you're debugging, you might want to stop any further processing, e.g.

view plain print about
1new dBug($_POST);
2exit;

Check out the examples and then give it a shot, it'll save you a ton of time on those days when you simply must write some php.