Re: passing multidimentional arrays between pages
| From: | Matt McClanahan | Date: | Sat, 01 Jul 2000 20:51:38 +0000 |
| Subject: | Re: passing multidimentional arrays between pages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4297@lists.php.net to get a copy of this message | ||
On Sun, 2 Jul 2000, Nick Allan wrote:
> Hi all
> I'm having some problem passing multidimentional arrays between two php
> files.
> ie
> The array is created in search.php3 and I want to pass all its contents to
> edit.php3
> According to something I saw in the mailing list archives, I should be
> able to use serialize and unserialize. I assume I also have to urlencode
> and urldecode.
> in search.php3 I've got the following code
> $passinfo = urlencode(serialize($info));
> ?>
> <form method=post action=edit.php3?passinfo=<?echo $passinfo?>>
>
> in edit.php3 I've got
> $info = unserialize(urldecode($passinfo));
>
> according to gettype the variable $info is nolonger an array, its a
> boolean.
> I'm obviously missing something here, can anyone enlighten me on how I do
> this procedure?
Order of operations. If you serialize, then urlencode, you'll need to
urldecode, then unserialize.
Matt