Page 1 of 1

What is the syntax for passing an array through the url?

Posted: Tue Aug 07, 2007 11:15 am
by Yourchild
I have an array in page 1 such as this:

$myArray[0] =1;
$myArray[1] = 2;


etc etc....



I want to pass this array through the url into page 2:

header("Location: ".myURLAndDir()."invited.php"."?type=massmail"."&thisArray=".$myArray);

Is this the correct syntax for passing the array?

Posted: Tue Aug 07, 2007 11:33 am
by VladSun

Code: Select all

$URLArray = base64_encode(serialize($Array)); // write
$Array = unserialize(base64_decode($_GET['Array'])); //read

Posted: Tue Aug 07, 2007 12:34 pm
by Yourchild
thanks a lot! that worked smoothly!! :o