Re: Grab an array from a cookie without throwing errors?
| From: | Matt M. | Date: | Fri, 08 Oct 2004 15:49:57 +0000 |
| Subject: | Re: Grab an array from a cookie without throwing errors? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198978@lists.php.net to get a copy of this message | ||
> $cookie = $_COOKIE['bookmarks'];
> if(unserialize($cookie) == true) {
> $bookmarks = unserialize($cookie);
> } else {
> $bookmarks = array();
> }
if (isset($_COOKIE['bookmarks'])) {
$cookie = $_COOKIE['bookmarks'];
if(unserialize($cookie) == true) {
$bookmarks = unserialize($cookie);
} else {
$bookmarks = array();
}
}