Source of: /manual/en/reserved.variables.get.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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.get.php',
1 => '$_GET',
),
'up' =>
array (
0 => 'reserved.variables.php',
1 => 'Predefined Variables',
),
'prev' =>
array (
0 => 'reserved.variables.server.php',
1 => '$_SERVER',
),
'next' =>
array (
0 => 'reserved.variables.post.php',
1 => '$_POST',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="reserved.variables.get" class="refentry">
<div class="refnamediv">
<h1 class="refname">$_GET</h1>
<h1 class="refname">$HTTP_GET_VARS [deprecated]</h1>
<p class="refpurpose"><span class="refname">$_GET</span> -- <span class="refname">$HTTP_GET_VARS [deprecated]</span> — <span class="dc-title">HTTP GET variables</span></p>
</div>
<a name="reserved.variables.get.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<p class="para">
An associative array of variables passed to the current script
via the URL parameters.
</p>
<p class="simpara">
<var class="varname">$HTTP_GET_VARS</var> contains the same initial
information, but is not a <a href="language.variables.superglobals.php" class="link">superglobal</a>.
(Note that <var class="varname">$HTTP_GET_VARS</var> and <var class="varname">$_GET</var>
are different variables and that PHP handles them as such)
</p>
</div>
<a name="reserved.variables.get.changelog"></a><div class="refsect1 changelog">
<h3 class="title">Changelog</h3>
<p class="para">
</p><table class="doctable informaltable">
<thead valign="middle">
<tr valign="middle">
<th>Version</th>
<th>Description</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left">4.1.0</td>
<td align="left">
Introduced <var class="varname">$_GET</var> that deprecated
<var class="varname">$HTTP_GET_VARS</var>.
</td>
</tr>
</tbody>
</table>
<p>
</p>
</div>
<a name="reserved.variables.get.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <var class="varname">$_GET</var> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">'Hello ' </span><span style="color: #007700">. </span><span style="color: #0000BB">htmlspecialchars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #DD0000">"name"</span><span style="color: #007700">]) . </span><span style="color: #DD0000">'!'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
<div class="example-contents simpara"><p>
Assuming the user entered http://example.com/?name=Hannes
</p></div>
<div class="example-contents para"><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>
</p>
</div>
<a name="reserved.variables.get.notes"></a><div class="refsect1 notes">
<h3 class="title">Notes</h3>
<blockquote><p><b class="note">Note</b>: This is a 'superglobal', 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.
<br /></p></blockquote>
</div>
<a name="reserved.variables.get.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="language.variables.external.php" class="link">Handling external variables</a></li>
<li class="member"><a href="book.filter.php" class="link">The filter extension</a></li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>