note 39710 deleted from function.serialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 02:03:31 +0000 |
| Subject: | note 39710 deleted from function.serialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191744@lists.php.net to get a copy of this message | ||
Note Submitter: Jouhni [jouhni at web dot de]
----
In order to save serialized values in cookies you have to pay attention to the following:
A serialized array looks like this:
a:2:{i:0;s:9:"Element 1";i:1;s:9:"Element 2";}
Because quotation marks are saved with a backslash in front of it in cookies it is not possible to
unserialize a cookie-saved serialized array. You have to do a stripslashes() before unserializing
the cookie.