Make array of all GET-variables

Emil picture Emil · Jul 20, 2010 · Viewed 74.9k times · Source

I'm trying to make an array from all the GET-variables passed to a PHP script. So far I haven't found any way to do this.

Is this possible?

Answer

Pekka picture Pekka · Jul 20, 2010

It's already there by default:

print_r($_GET);  // for all GET variables
print_r($_POST); // for all POST variables

PHP docs on all available superglobals