Hi,

    this is an extract from setcookie documentation - how to handle a cookie
array.

    Is this what you were looking for??



You may also set array cookies by using array notation in the cookie name.
This has the effect of setting as many cookies as you have array elements,
but when the cookie is received by your script, the values are all placed in
an array with the cookie's name:


setcookie ("cookie[three]", "cookiethree");
setcookie ("cookie[two]", "cookietwo");
setcookie ("cookie[one]", "cookieone");
if (isset ($cookie)) {
    while (list ($name, $value) = each ($cookie)) {
        echo "$name == $value<br>\n";
    }
}

----- Original Message -----
From: "Sparky Kopetzky" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 10:10 PM
Subject: [PHP] Cookies- peanut butter or chocolate??


Yes, this question is about PHP cookies.

Two questions:
1. How do you setup a cookie that will not expire??
2. How do you put 2 items that you want to save in the cookie and retrieve??
Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to