php output debug

This output debug is is a quick snippet to use when Devel's krumo output is not available.

<?php
 
//Remove this helper
function dbg($thing = '', $message = '',$exit = FALSE) {
 
$output "<p>---- $message ----</p>\n";
  if ((
is_array($thing)) || (is_object($thing))) {
   
$output .= "<pre>\n";
   
$output .= print_r($thing,TRUE);
   
$output .= "</pre>\n";
  }
  else {
   
$output .=  "<p>-&gt;$thing&lt;-</p>\n";
  }

  ($exit) ? exit($output) :  print $output;;
}
?>