\n"; $prefix = '
'; $suffix = "\n"; } $backtrace = debug_backtrace(); echo $backtrace[0]['file'], ':', $backtrace[0]['line'], $delim; foreach (func_get_args() as $var) { echo $prefix; if (is_scalar($var) || is_null($var)) { var_dump($var); } else { print_r($var); } echo $suffix, $delim; } exit; } function __getHttpHeader($header) { if (empty($header)) { return false; } // Try to get it from the $_SERVER array first $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); if (!empty($_SERVER[$temp])) { return $_SERVER[$temp]; } // This seems to be the only way to get the Authorization header on // Apache if (function_exists('apache_request_headers')) { $headers = apache_request_headers(); if (!empty($headers[$header])) { return $headers[$header]; } } return false; } function _ve() { $version = (isset($_SERVER['SERVER_PROTOCOL']) && $_SERVER['SERVER_PROTOCOL'] === '1.0') ? '1.0' : '1.1'; header("HTTP/{$version} 303 See Other"); if ('XMLHttpRequest' == __getHttpHeader('X_REQUESTED_WITH')) { header('Content-Type: text/plain; charset=utf-8'); $delim = "\n"; $prefix = ''; $suffix = "\n"; } else { header('Content-Type: text/html; charset=utf-8'); $delim = "
'; $suffix = "\n"; } $backtrace = debug_backtrace(); echo $backtrace[0]['file'], ':', $backtrace[0]['line'], $delim; foreach (func_get_args() as $var) { echo $prefix; var_export($var); echo $suffix, $delim; } exit; } // END OF GLOBAL FUNCTIONS