Skip to content

Instantly share code, notes, and snippets.

@josuecau
Created November 30, 2012 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josuecau/4178471 to your computer and use it in GitHub Desktop.
Save josuecau/4178471 to your computer and use it in GitHub Desktop.
PHP $_SERVER global variable: server and execution environment information
<?php $title = 'PHP $_SERVER global variable: server and execution environment information'; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<style>
html { font-size : 100%; }
body { font-family : Monaco, "Andale Mono", "Courier New", Courier, monospace; font-size : 0.8em; color : #333; padding : 10px; }
h1 { font-size : 21px; }
table { width : 100%; }
td, th { padding : 5px 10px; }
th { text-align : left; font-weight : bold; color : #111; }
.odd { background : #F2F2F2; }
</style>
</head>
<body>
<h1><?php echo $title; ?></h1>
<table>
<?php $i = 0; foreach ($_SERVER as $key => $value) : $i++; ?>
<tr<?php if ($i % 2 == 0) : ?> class="odd"<?php endif; ?>>
<th><?php echo $key; ?></th>
<td><?php echo $value; ?></td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment