PHP $_GET
$_GET contains an array of variables received via the HTTP GET method.
There are two main ways to send variables via the HTTP GET method:
- Query strings in the URL
- HTML Forms
Query string in the URL
A query string is data added at the end of a URL. In the link below, everything after the ?
sign is part of the query string:
<a href="demo_phpfile.php?subject=PHP&web=W3schools.com">Test $GET</a>
The query string above contains two key/value pairs:
subject=PHP
web=W3schools.com
In the PHP file we can use the $_GET
variable to collect the value of the query string. Continue reading PHP – $_GET