function print_s($var, $depth = 4, $return = false, $html = true, $level = 0) { global $DEBUG_IP; if (!in_array($_SERVER['REMOTE_ADDR'], $DEBUG_IP) && !empty($_SERVER['SERVER_NAME'])) return; if ($depth == 0) return ; $spaces = ""; $space = $html ? " " : " "; $newline = $html ? "
" : "\n"; for ($i = 1; $i <= 6; $i++) { $spaces .= $space; } $tabs = $spaces; for ($i = 1; $i <= $level; $i++) { $tabs .= $spaces; } $type = gettype($var); if ($type == 'boolean') $output = "$prefix $type : ".($var?'true':'false')." $newline"; elseif ($type != 'array' && $type !='object') { $output = "$prefix $type : $var $newline"; } else { if ($type == 'array') { $title = "Array"; } elseif ($type == 'object') { $title = get_class($var)." Object"; } $output = $prefix . $title . $newline ; foreach($var as $key => $value) { if (is_array($value) || is_object($value)) $value = print_s($value, $depth-1, true, $html, $level+1); $output .= $prefix . $tabs . "[" . $key . "] => " . $value . $newline; } } if ($return) return $output; else echo preg_replace('/('.$newline.')+/', $newline, $output); } Events - ROSSIGNOL