Return to Snippet

Revision: 4533
at January 2, 2008 14:51 by johnself

Initial Code
Here are two options for passing an array via GET parameters (in a url):

<A href="example.html?arr[]=val1&arr[]=val2&arr[]=val3">test</A>

<A href="example.html?arr=<?PHP echo serialize($arr); ?>">test</A>

In the first example, you can use $_GET["arr"] as an array.
In the second you will first have to:

 $arr = unserialize($_GET["arr"]); 

Initial URL

Initial Description

Initial Title
Passing an array through GET request

Initial Tags
url, array

Initial Language