dprint_r

Versions
mediamosa-21
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.

▾ 6 functions call dprint_r()

ddebug_backtrace in sites/all/modules/devel/devel.module
Print the function call stack.
devel_shutdown_query in sites/all/modules/devel/devel.module
dpr in sites/all/modules/devel/devel.module
An alias for dprint_r(). Saves carpal tunnel syndrome.
dvm in sites/all/modules/devel/devel.module
Var_dump() a variable to the 'message' area of the page. Uses drupal_set_message()
dvr in sites/all/modules/devel/devel.module
Like dpr, but uses var_dump() instead
kprint_r in sites/all/modules/devel/devel.module

Code

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;
    }
  }
}
?>