Q:

Is it possible to read environment variables from php?

The environment variable logonserver is available from the cmd prompt
echo %logonserver%

Is it possible to read this variable from php which will be accessed via a browser and not the cmd prompt, which means I can't pass the value in as a parameter.
I know I could shell out to cmd and get it that way, but I was wondering if there was some built-in php functionality for this.

A:

Yes. All environment variables are accessible through super-global $_SERVER variable. Just try var_dump($_SERVER) to see what's inside.

