[Pugged] Using environment variables

David Champion ciapug@ciapug.org
Thu, 19 Sep 2002 15:10:22 -0500


Claus wrote:
> Hi
> 
> Which one is the preferred way to get the environment variables from the 
> web server (as listed in phpinfo()) and why?
> 
> Examples:
> result = $HTTP_ACCEPT_LANGUAGE;
> result = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
> result = getenv ("HTTP_ACCEPT_LANGUAGE");
> ... any others that I forgot

I use the first way... simply because it's shorter to type. The others 
might be more obvious to read - since you see that it's not just another 
PHP var.

-dc