Re: Cookies- peanut butter or chocolate??
| From: | Don Read | Date: | Fri, 20 Jun 2003 17:14:07 +0000 |
| Subject: | Re: Cookies- peanut butter or chocolate?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152325@lists.php.net to get a copy of this message | ||
On 19-Jun-2003 Steve Keller wrote:
> At 6/19/2003 02:10 PM, Sparky Kopetzky wrote:
>
> > 2. How do you put 2 items that you want to save in the cookie and
> retrieve??
>
> Smuch 'em together into a single variable with a delimiter you're sure
> won't show up in either value, something like "#@@#", between them. Then,
> when you read the cookie value in, just explode it by your delimiter.
>
setcookie (twovar, serialize(array($var1, $var2)), ...);
...
list($var1, $var2) = unserialize($_COOKIE['twovar']);
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)