PHP Env

$_ENV is a superglobal that contains environment variables. Environment variables are provided by the shell under which PHP is running, so they may vary according to different shells.

You can display all your environment variables pronting out $_ENV:

<?php 
echo "<pre>";
print_r($_ENV);
echo "</pre>";

/* ****environment variables on a mac machine****
Array
(

=> ***
[TMPDIR] => ***
[Apple_PubSub_Socket_Render] => ***
[USER] => ***
[SSH_AUTH_SOCK] => ***
[__CF_USER_TEXT_ENCODING] => ***
[PATH] => ***
[PWD] => ***
[HOME] => ***
[SHLVL] => ***
[DYLD_LIBRARY_PATH] => ***
[LOGNAME] => ***
[__LAUNCHD_FD] => ***
[DISPLAY] => ***
[_] => ***
[COMMAND_MODE] => ***
)
*/
?>

To display an environment variable you can also use getenv()

<?php 
echo getenv('USER');
?>

PHP Env

$_ENV is a superglobal that contains environment variables. Environment variables are provided by the shell under which PHP is running, so they may vary according to different shells.

You can display all your environment variables pronting out $_ENV:

To display an environment variable you can also use getenv()