Raspy-voiced Web development

Save some time with $_SERVER variables

I spend a lot of time testing out certain things with $_SERVER array.  I often forget what I should be getting as a value for a specific variable.  Sometimes what variable it is that I am wanting to work with.  Here’s a quick loop that can generate the $_SERVER array all nice and neat like:

foreach ($_SERVER as $variable => $value) {
	echo $variable . " = " . $value . "<br />";
}

To jazz it up, you can add unordered list elements or tables to it.  What’s not to love?

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Categories