The $_GET superglobal is defined as part of the URL string:

http://example.org/index.php?foo=bar&baz=1

In index.php:

echo $_GET['foo']; // bar
echo $_GET['baz']; // 1

So $_GET is not stored on the server, but is passed with each HTTP request, as is $_POST, but that is passed in the HTTP headers rather than simply appened to the end of the URL.

Answer from kingcoyote on Stack Overflow
๐ŸŒ
PHP
php.net โ€บ manual โ€บ en โ€บ reserved.variables.get.php
PHP: $_GET - Manual
The above example will output something similar to: Hello Hannes! ... 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 global $variable; to access it within functions or methods. ... The values in $_GET are automatically passed through urldecode().
๐ŸŒ
W3Schools
w3schools.com โ€บ php โ€บ php_superglobals_get.asp
PHP $_GET Superglobal
The $_GET superglobal contains an array of variables received via the HTTP GET method.
๐ŸŒ
EDUCBA
educba.com โ€บ home โ€บ software development โ€บ software development tutorials โ€บ php tutorial โ€บ php get method
PHP GET Method | How PHP GET Method Works? (Examples)
April 10, 2023 - This is the example of using the GET METHOD of the PHP Programming Language. Here at first error_reporting() function is used to handle the error one time. Then x1 and y1 variables are used with the GET METHOD f1 and s1 values in it.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
๐ŸŒ
Pi My Life Up
pimylifeup.com โ€บ home โ€บ how to use php $_get global variable
How to use PHP $_GET Global Variable - Pi My Life Up
August 4, 2022 - We named our script get.php and stored it on an accessible local development server. Our query string has bg=beige where name is bg and value is beige. You can access the value by using the name in our GET variable, for example, $_GET['bg'].
Top answer
1 of 2
9
Hi Kristian, You're definitely on the right track but just to clarify a few things: I'm trying to wrap my head around this $_GET function $_GET is not a function, it's an associative array. 1) If you add a question mark at the end of a URL e.g. "?category=books" - the word after the question mark - "category", becomes a variable and the word "books", becomes its value Yes. 2) The function takes a string variable name - $_GET["category"] Looping back to the first statement, $_GET is an associative array, not a function. An array holds a collection of variables, where as a function is for executing a block of code. 3) The function isset(), checks for a variable "category" in the URL Yes, mostly. isset(...) takes any variable you pass to it, and determines if it's value is NULL or not. For example: ``` /* given the url http://www.mywebsite.com/mypage.php?category=books */ isset($GET["category"]); // returns true, because category is a parameter that gets passed to the $GET array isset($GET["foobar"]); // returns false, because foobar is not a parameter, so it does not exist in the $GET array isset($myVar); // returns false because $myVar is not defined. ``` 4) If the variable exists in the URL, the $_GET function takes the value from the variable - in this case, "books" Yep, but to clarify the terminology: "If the parameter exists in the URL, the $_GET array takes the value from the parameter" 5) You can then use a conditional statement to see what the value of "category" is, and run a code block Precisely! Here are some documentation links on the relevant topics: - arrays (http://php.net/manual/en/language.types.array.php) - functions (http://php.net/manual/en/functions.user-defined.php) - superglobals (http://php.net/manual/en/language.variables.superglobals.php) - isset (http://php.net/manual/en/function.isset.php) Hope that's helpful.
2 of 2
0
Kristian, You're 100% correct and that code will work without any issues! :) If you need help modifying it or adding more, let me know. -Nick
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ php-get
PHP $_GET
August 28, 2020 - The difference between $_GET and $_POST is that the former uses URL parameters to pass form data, while the latter uses the HTTP POST method. Suppose a user visits the URL: http://example.com/?name=John&age=25.
Find elsewhere
๐ŸŒ
CodeWithHarry
codewithharry.com โ€บ tutorial โ€บ php-get
$_GET | PHP Tutorial | CodeWithHarry
We can access the values in name_get.php with the $_GET superglobal.
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ php โ€บ php_get_post.htm
PHP - GET & POST
The PHP provides $_GET associative array to access all the sent information using GET method. Try out following example by putting the source code in test.php script.
๐ŸŒ
W3Schools
w3schools.sinsixx.com โ€บ php โ€บ php_get.asp.htm
PHP GET - SinSiXX - W3Schools
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
๐ŸŒ
YouTube
youtube.com โ€บ watch
PHP Tutorial for Beginners 17 # Using $_GET Variables in PHP - YouTube
get - PHP $_GET Variablephp - How to set $_GET variablePHP - easiest way to get $_GET parameters string as writtenPHP: $_GET php $_requestphp $_get arrayphp ...
Published: August 6, 2014
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ php โ€บ get-and-post-in-php
$_GET and $_POST in PHP - GeeksforGeeks
July 23, 2025 - <?php echo $_GET['username']; // Outputs the value of the 'username' parameter from the URL ?> Now, let us understand with the help of the example:
๐ŸŒ
W3Schools
w3schools.in โ€บ php โ€บ get-post
PHP GET and POST - W3schools
$_GET and $_POST are Superglobal variables in PHP which used to collect data from HTML form and URL. This chapter shows how to collect submitted form-data from users by using POST and GET method. The example below contains an HTML form with two input fields, and a submit button:
๐ŸŒ
SitePoint
sitepoint.com โ€บ php
Understanding $_get in PHP - A detailed discussion - PHP - SitePoint Forums | Web Development & Design Community
January 1, 2019 - This resource is more like notes of someone who has mastered the language โ†’ http://php.net/manual/en/reserved.variables.get.php But novice like me seems to be struggling even to grasp the basics of $_GET. I know there โ€ฆ
๐ŸŒ
YouTube
youtube.com โ€บ bro code
PHP $_GET and $_POST explained - YouTube
PHP get and post super global variables00:00:00 intro00:02:53 $_GET00:05:30 $_POST00:07:00 exercise
Published: May 20, 2024
Views: 12K
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ php โ€บ php_superglobals_get.htm
PHP - $_GET
<?php echo "Hello, " . $_GET['name'] . "!"; echo " You are " . $_GET['age'] .
๐ŸŒ
Studyopedia
studyopedia.com โ€บ home โ€บ php get method
PHP GET Method - Studyopedia
May 4, 2023 - There is a limitation of 1024 characters while sending information through GET. PHP superglobal variable $_GET is used to collect form data with GET.
๐ŸŒ
W3Schools
w3schools.com โ€บ php โ€บ php_forms.asp
PHP Form Handling
The PHP superglobals $_GET and $_POST are used to collect form-data. The example below displays a simple HTML form with two input fields and a submit button: