Re: pass array
| From: | AJDIN BRANDIC | Date: | Fri, 03 Nov 2000 09:32:44 +0000 |
| Subject: | Re: pass array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23541@lists.php.net to get a copy of this message | ||
Thanks all.
Ajdin
On Thu, 2 Nov 2000, Matt McClanahan wrote:
> On Thu, 2 Nov 2000, AJDIN BRANDIC wrote:
>
> > Hi,
> >
> > Is it possible to pass an array from one page to another without using
> > cookies or sessions. ie. as a hidden form feild or href=blah.php3?myarray[]
> > ??????
>
> I wonder if this shouldn't be a faq entry somewhere. It comes up fairly
> reguarly.
>
> Yes, you can pass arrays between pages. To do so, you must first
> serialize and urlencode the array.
>
> Page 1:
>
> $param = urlencode(serialize($array));
> echo '<a href="page2.php?param=' . $param . '">Pass
> array</a>';
>
> Page 2:
>
> $array = unserialize(urldecode($param));
>
> http://www.php.net/manual/function.serialize.php
> http://www.php.net/manual/function.urlencode.php
>
> Matt
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>