28 $_replace = array(
"\n"=>
'<i>\n</i>',
"\r"=>
'<i>\r</i>',
"\t"=>
'<i>\t</i>');
30 $results =
"<b>Array (" . count(
$var) .
")</b>";
31 foreach (
$var as $curr_key => $curr_val) {
33 $results .=
"<br>" . str_repeat(
' ', $depth * 2) .
"<b>" . strtr($curr_key, $_replace) .
"</b> => {$return}";
35 }
else if (is_object(
$var)) {
36 $object_vars = get_object_vars(
$var);
37 $results =
"<b>" . get_class(
$var) .
" Object (" . count($object_vars) .
")</b>";
38 foreach ($object_vars as $curr_key => $curr_val) {
39 if (is_object($curr_val)) {
40 $return =
'[object ' . get_class($curr_val) .
']';
44 $results .=
"<br>" . str_repeat(
' ', $depth * 2) .
"<b>{$curr_key}</b> => {$return}";
46 }
else if (is_resource(
$var)) {
47 $results =
'<i>' . (string)
$var .
'</i>';
48 }
else if (empty(
$var) &&
$var !=
"0") {
49 $results =
'<i>empty</i>';
51 if (strlen(
$var) > $length) {
52 $results = substr(
$var, 0, $length - 3) .
'...';
56 $results = htmlspecialchars($results);
57 $results = strtr($results, $_replace);
smarty_modifier_debug_print_var($var, $depth=0, $length=40)