dprint_r($input, $return = FALSE, $name = NULL, $function = 'print_r', $check= TRUE)Pretty-print a variable to the browser (no krumo). Displays only for users with proper permissions. If you want a string returned instead of a print, use the 2nd param.
sites/all/modules/devel/devel.module, line 1737
<?php
function dprint_r($input, $return = FALSE, $name = NULL, $function = 'print_r', $check= TRUE) {
if (user_access('access devel information')) {
if ($name) {
$name .= ' => ';
}
ob_start();
$function($input);
$output = ob_get_clean();
if ($check) {
$output = check_plain($output);
}
if (count($input, COUNT_RECURSIVE) > DEVEL_MIN_TEXTAREA) {
// don't use fapi here because sometimes fapi will not be loaded
$printed_value = "<textarea rows=30 style=\"width: 100%;\">\n". $name . $output .'</textarea>';
}
else {
$printed_value = '<pre>'. $name . $output .'</pre>';
}
if ($return) {
return $printed_value;
}
else {
print $printed_value;
}
}
}
?>