Created
November 30, 2012 20:46
-
-
Save josuecau/4178471 to your computer and use it in GitHub Desktop.
PHP $_SERVER global variable: server and execution environment information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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