Re: Passing an Array in the URL
| From: | Matt McClanahan | Date: | Thu, 26 Oct 2000 05:20:03 +0000 |
| Subject: | Re: Passing an Array in the URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22050@lists.php.net to get a copy of this message | ||
On Thu, 26 Oct 2000, David Robley wrote:
> On Thu, 26 Oct 2000, Matt wrote:
> > How can I pass an array in the url? I remember there is some function that
> > text econdes it and some other one that will decode into an array again.
>
> That would be serialize() and unserialize()
And urlencode() and urldecode(). Passing a serialized array by itself
will make a mess.
To send...
$param = urlencode(serialize($array));
echo '<a href="file.php?param=' . $param . '">';
And on the other side
$array = unserialize(urldecode($param));
Matt