Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

where are you getting the $_GET["cat"] variable from?

Hi, I could not figure out where is the $_GET["cat"] variable

1 Answer

Simon Coates
Simon Coates
8,481 Points

$_GET is a what's known as a superglobal. The PHP documentation states that it is an "associative array of variables passed to the current script via the URL parameters (aka. query string). Note that the array is not only populated for GET requests, but rather for all requests with a query string.". It's a means of finding out information about the current request. For a reference to $_GET["cat"] to make sense, you're probably dealing with a URL param with name of "cat". eg. http://url.com?cat=something