This is my extension of an existing function, adatped for my requirements.
";
$output .= "";
$output .= "";
$output .= "" . $VARIABLE_NAME . " ";
$output .= " ";
$output .= "";
if (is_array($data)){
foreach ($data as $key => $value) {
//$value = dumpr($key, $value);
$output .= "";
$output .= "$key ";
$output .= "$value ";
$output .= " ";
}
} else {
$output .= "";
$output .= "$data ";
$output .= " ";
}
$output .= "";
$output .= "";
return $output;
}
?>
Use like this:
echo dumpr(‘NAME’,$var);
echo dumpr(‘SESSION’,$_SESSION);
etc..
Displays a nicely formatted table, with values of a string / array / object clearly displayed.