⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reserved.variables.environment.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Environment variables</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.session.html">$_SESSION</a></div> <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.cookies.html">$_COOKIE</a></div> <div class="up"><a href="reserved.variables.html">Predefined variables</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="reserved.variables.environment" class="refentry"> <div class="refnamediv">  <h1 class="refname">$_ENV</h1>  <h1 class="refname">$HTTP_ENV_VARS [deprecated]</h1>  <p class="refpurpose"><span class="refname">$_ENV</span> -- <span class="refname">$HTTP_ENV_VARS [deprecated]</span> &mdash; <span class="dc-title">Environment variables</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <p class="para">   An associative <a href="language.types.array.html" class="type array">array</a> 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>  <p class="simpara">   <var class="varname">$HTTP_ENV_VARS</var> contains the same initial   information, but is not a <a href="language.variables.superglobals.html" class="link">superglobal</a>.    (Note that <var class="varname">$HTTP_ENV_VARS</var> and <var class="varname">$_ENV</var>   are different variables and that PHP handles them as such)  </p> </div>  <div class="refsect1 changelog">  <h3 class="title">ChangeLog</h3>  <p class="para">   <table class="informaltable">    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Version</th>       <th colspan="1">Description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.1.0</td>       <td colspan="1" rowspan="1" align="left">        Introduced <var class="varname">$_ENV</var> that deprecated        <var class="varname">$HTTP_ENV_VARS</var>.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div>  <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example" id="variable.env.basic" name="variable.env.basic">    <p><b>Example #1 <var class="varname">$_ENV</var> example</b></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&nbsp;</span><span style="color: #DD0000">'My&nbsp;username&nbsp;is&nbsp;'&nbsp;</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">]&nbsp;.&nbsp;</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"><pre><div class="cdata"><pre>My username is bjori!</pre></div>    </pre></div>   </div>  </p> </div>  <div class="refsect1 notes">  <h3 class="title">Notes</h3>  <blockquote><p><b class="note">Note</b>: This is a &#039;superglobal&#039;, orautomatic global, variable. This simply means that it is available inall scopes throughout a script. There is no need to do <strong class="command">global $variable;</strong> to access it within functions or methods.<br /></p></blockquote> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.getenv.html" class="function" rel="rdfs-seeAlso">getenv()</a></li>    <li class="member"><a href="book.filter.html" class="link">The filter extension</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.session.html">$_SESSION</a></div> <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.cookies.html">$_COOKIE</a></div> <div class="up"><a href="reserved.variables.html">Predefined variables</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -