debug($data, $label = NULL, $print_r = FALSE)Debug function used for outputting debug information.
The debug information is passed on to trigger_error() after being converted to a string using _drupal_debug_message().
$data Data to be output.
$label Label to prefix the data.
$print_r Flag to switch between print_r() and var_export() for data conversion to string. Set $print_r to TRUE when dealing with a recursive data structure as var_export() will generate an error.
includes/common.inc, line 6133
<?php
function debug($data, $label = NULL, $print_r = FALSE) {
// Print $data contents to string.
$string = $print_r ? print_r($data, TRUE) : var_export($data, TRUE);
trigger_error(trim($label ? "$label: $string" : $string));
}
?>