I am having a similar problem on a site Im working on, I need to pass an array through an anchor. simply adding
?margin_data=$margin_data
to the end of the HREF doesn't work, it simply passes the value "Array" rather than the data inside the array. I dont want to have to write a
foreach ($margin_data as $x) echo $x, ;
inside the anchor tag, and then have to re-build the array on the next page because this just seems like a really sloppy way to do it... I know there has to be a way to do it...
I basically need to pass a variable about of data through an array variable. the data includes image id numbers that correspond to images on that right hand margin that are selected randomly through a MYsql query in a separate function. I need to retain these id numbers on specific hyperlinks so that I can limit the page from changing those images so as not to draw the eye away from the intended effect... if anyone has an idea... that would be helpful...
[edit]
nevermind I found something that will work....
implode and explode...
implode the variable to a comma separated value, pass the variable through the url, then explode the comma separated value back into an array variable...
$csv = implode(",",$margin_data);
a href='?page_id=6&csv=$csv'
and on page_id 6
$margin_data = explode(",",$csv);