PDA

View Full Version : array passing


usban
10-28-2002, 05:05 PM
I would like to know if i can pass an array to another page like a simple variable, i mean

$test = Array(a,b,c,d,e)

file.php?array=$test

I don't think so, but i would like to know if there is a way to do something simliar without having to do something like this:

fila.php?var1=$test[0]&var2=test[1] & [...] &var5=$test[4]

:confused:

Ökii
10-28-2002, 06:02 PM
few choices for this one.

$passedvar = implode(":",$array);
.... through url ......
$array = explode(":",$passedvar);

or

$passedvar = serialize($array);
.... through url ......
$array = unserialize($passedvar);