Re: POST-ing or GET-ing an array

From: Date: Tue, 29 Oct 2002 19:13:33 +0000
Subject: Re: POST-ing or GET-ing an array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-121921@lists.php.net to get a copy of this message
Checkout serialize(); and unserialize(); http://www.php.net/manual/en/function.serialize.php http://www.php.net/manual/en/function.unserialize.php //On your first page.. $myarray = serialize($myarray); echo "<a href=\"myarray=$myarray\">Link</a>"; //Then on your other page.. $myarray = unserialize($_GET['myarray']); print_r($myarray); -Kevin ----- Original Message ----- From: "Petre Agenbag" <internet@vsa.co.za> To: <php-general@lists.php.net> Sent: Tuesday, October 29, 2002 10:40 AM Subject: [PHP] POST-ing or GET-ing an array > Hi > I KNOW I'm gonna get flamed, but I can't find this anywhere in my books > or in the manual, yet I know I've read it somewhere. > > I created an array in a loop as such: > > $sql = "select stuff from my_table"; > $result = mysql_query($sql); > $count = 0; > > while ($myrow = mysql_fetch_assoc($result)) { > $id = $myrow["id"]; > $my_array[$count] = $id; > } > > > Now, I want to send that array to another page with a normal: > > <a href="next_page.php?array=$my_array">Next</a> > > BUT, that obviously doesn't work... > > Please just help me out, I'm suffering... > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#121921) next »