php man page for getenv

Query: getenv

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

GETENV(3)								 1								 GETENV(3)

getenv - Gets the value of an environment variable

SYNOPSIS
string getenv (string $varname)
DESCRIPTION
Gets the value of an environment variable. You can see a list of all the environmental variables by using phpinfo(3). Many of these variables are listed within RFC 3875, specifi- cally section 4.1, "Request Meta-Variables".
PARAMETERS
o $varname - The variable name.
RETURN VALUES
Returns the value of the environment variable $varname, or FALSE if the environment variable $varname does not exist.
EXAMPLES
Example #1 getenv(3) Example <?php // Example use of getenv() $ip = getenv('REMOTE_ADDR'); // Or simply use a Superglobal ($_SERVER or $_ENV) $ip = $_SERVER['REMOTE_ADDR']; ?>
SEE ALSO
putenv(3), apache_getenv(3), Superglobals. PHP Documentation Group GETENV(3)
Related Man Pages
getenv(3c) - opensolaris
secure_getenv(3) - linux
getenv(3) - centos
setenv(3) - netbsd
unsetenv(3) - netbsd
Similar Topics in the Unix Linux Community
getenv(3c)