Debugging variables, GET, POST, SESSION, SERVER, ENV

I usually write my own vars out to the screen for debugging using ‘print_r($_SESSION)’,’print_r($_POST)’etc inside <pre> tags, but this is awesome! (a little too much even). It’s like phpinfo(), but for your webpage!

";
      $output .= "" . $VARIABLE_NAME . "VALUE";
      foreach ($VARIABLE_ARRAY as $key => $value) {
         $value = variable_array_dump($key, $value);
         $output .= "$key$value";
      }
      $output .= "";
      return $output;
   } else {return strval($VARIABLE_ARRAY);}
}
echo variable_array_dump('GLOBAL SERVER', $_SERVER);
echo variable_array_dump('GLOBAL ENV', $_ENV);
echo variable_array_dump('GLOBAL REQUEST', $_REQUEST);
echo variable_array_dump('GLOBAL GET', $_GET);
echo variable_array_dump('GLOBAL POST', $_POST);
echo variable_array_dump('GLOBAL COOKIE', $_COOKIE);
?>

If you want a simpler version, or need to just add something quick, try this:


echo '
';
print_r($_GET);
print_r($_POST);
print_r($_SESSION);
echo 'end/pre';