Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 11033

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>HTTP Cookies</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.environment.html">$_ENV</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.phperrormsg.html">$php_errormsg</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.cookies" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$_COOKIE</h1>
  <h1 class="refname">$HTTP_COOKIE_VARS [deprecated]</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5)</p><p class="refpurpose"><span class="refname">$_COOKIE</span> -- <span class="refname">$HTTP_COOKIE_VARS [deprecated]</span> &mdash; <span class="dc-title">HTTP Cookies</span></p>

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

  <p class="simpara">
   <var class="varname"><var class="varname">$HTTP_COOKIE_VARS</var></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"><var class="varname">$HTTP_COOKIE_VARS</var></var> and <var class="varname"><var class="varname">$_COOKIE</var></var>
   are different variables and that PHP handles them as such)
  </p>

 </div>

 

 <div class="refsect1 changelog" id="refsect1-reserved.variables.cookies-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.1.0</td>
       <td>
        Introduced <var class="varname"><var class="varname">$_COOKIE</var></var> that deprecated
        <var class="varname"><var class="varname">$HTTP_COOKIE_VARS</var></var>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reserved.variables.cookies-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="variable.cookie.basic">
    <p><strong>Example #1 <var class="varname"><var class="varname">$_COOKIE</var></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&nbsp;</span><span style="color: #DD0000">'Hello&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">htmlspecialchars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_COOKIE</span><span style="color: #007700">[</span><span style="color: #DD0000">"name"</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 the &quot;name&quot; cookie has been set earlier
    </p></div>
    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Hello Hannes!
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-reserved.variables.cookies-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.cookies-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.setcookie.html" class="function" rel="rdfs-seeAlso">setcookie()</a> - Send a cookie</span></li>
    <li class="member"><a href="language.variables.external.html" class="link">Handling external variables</a></li>
    <li class="member"><a href="book.filter.html" class="link">The filter extension</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.environment.html">$_ENV</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.phperrormsg.html">$php_errormsg</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>