Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

_env(3) [php man page]

_ENV(3) 								 1								   _ENV(3)

$_ENV - Environment variables

	An associative array of variables passed to the current script via the environment method.

	These  variables are imported into PHP's global namespace from the environment under which the PHP parser is running. Many are provided by
       the shell under which PHP is running and different systems are likely running different kinds of shells, a definitive list  is  impossible.
       Please see your shell's documentation for a list of defined environment variables.

	Other environment variables include the CGI variables, placed there regardless of whether PHP is running as a server module or CGI proces-
       sor.

       $HTTP_ENV_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_ENV_VARS and $_ENV are different variables
       and that PHP handles them as such)

       +--------+---------------------------------------------------+
       |Version |						    |
       |	|						    |
       |	|		     Description		    |
       |	|						    |
       +--------+---------------------------------------------------+
       | 4.1.0	|						    |
       |	|						    |
       |	|  Introduced $_ENV that deprecated $HTTP_ENV_VARS. |
       |	|						    |
       +--------+---------------------------------------------------+
       Example #1

	      $_ENV example

	      <?php
	      echo 'My username is ' .$_ENV["USER"] . '!';
	      ?>

	       Assuming "bjori" executes this script

	      The above example will output something similar to:

	      My username is bjori!

       Note

	      This  is	a  'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script.
	      There is no need to do global $variable; to access it within functions or methods.

       getenv(3), The filter extension.

PHP Documentation Group 														   _ENV(3)

Check Out this Related Man Page

APACHE_REQUEST_HEADERS(3)						 1						 APACHE_REQUEST_HEADERS(3)

apache_request_headers - Fetch all HTTP request headers

SYNOPSIS
array apache_request_headers (void ) DESCRIPTION
Fetches all HTTP request headers from the current request. RETURN VALUES
An associative array of all the HTTP headers in the current request, or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.5.7 | | | | | | | This function became available in the CLI | | | server. | | | | | 5.4.0 | | | | | | | This function became available under FastCGI. | | | Previously, it was supported when PHP was | | | installed as an Apache module or by the NSAPI | | | server module in Netscape/iPlanet/SunONE web- | | | servers. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 apache_request_headers(3) example <?php $headers = apache_request_headers(); foreach ($headers as $header => $value) { echo "$header: $value <br /> "; } ?> The above example will output something similar to: Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 Host: www.example.com Connection: Keep-Alive NOTES
Note You can also get at the value of the common CGI variables by reading them from the environment, which works whether or not you are using PHP as an Apache module. Use phpinfo(3) to see a list of all of the available environment variables. SEE ALSO
apache_response_headers(3). PHP Documentation Group APACHE_REQUEST_HEADERS(3)
Man Page