<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.variables.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'reserved.variables.environment.php',
    1 => '$_ENV',
    2 => 'Environment variables',
  ),
  'up' => 
  array (
    0 => 'reserved.variables.php',
    1 => 'Predefined Variables',
  ),
  'prev' => 
  array (
    0 => 'reserved.variables.session.php',
    1 => '$_SESSION',
  ),
  'next' => 
  array (
    0 => 'reserved.variables.cookies.php',
    1 => '$_COOKIE',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/variables/env.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reserved.variables.environment" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$_ENV</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">$_ENV</span> &mdash; <span class="dc-title">Environment variables</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reserved.variables.environment-description">
  <h3 class="title">Description</h3>
  <p class="para">
   An associative <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of variables passed to the current script
   via the environment method. 
  </p>

  <p class="simpara">
   These variables are imported into PHP&#039;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&#039;s
   documentation for a list of defined environment variables.
  </p>

  <p class="simpara">
   Other environment variables include the CGI variables, placed
   there regardless of whether PHP is running as a server module or
   CGI processor.
  </p>

 </div>


 <div class="refsect1 examples" id="refsect1-reserved.variables.environment-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="variable.env.basic">
    <p><strong>Example #1 <var class="varname">$_ENV</var> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">'My username is ' </span><span style="color: #007700">.</span><span style="color: #0000BB">$_ENV</span><span style="color: #007700">[</span><span style="color: #DD0000">"USER"</span><span style="color: #007700">] . </span><span style="color: #DD0000">'!'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
     Assuming &quot;bjori&quot; executes this script
    </p></div>
    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">My username is bjori!</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-reserved.variables.environment-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">This is a &#039;superglobal&#039;, or
automatic global, variable. This simply means that it is available in
all scopes throughout a script. There is no need to do
<strong class="command">global $variable;</strong> to access it within functions or methods.
</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-reserved.variables.environment-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.getenv.php" class="function" rel="rdfs-seeAlso">getenv()</a> - Gets the value of a single or all environment variables</span></li>
    <li><a href="book.filter.php" class="link">The filter extension</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>