Re: serialize() function
| From: | tedd | Date: | Thu, 13 Apr 2006 22:58:35 +0000 |
| Subject: | Re: serialize() function | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233954@lists.php.net to get a copy of this message | ||
At 12:04 AM +0200 4/14/06, Jochem Maas wrote:
Nicholas Couloute wrote:Jochem: Not that you don't know -- because I'm sure you do -- but for the benefit of others. One example, each domain has a limit of cookies (20) and you can use them up pretty quickly. However, if you place your data in an array, you could then serialize the array and save it as one long string (i.e., the cookie). Then you can read it back from the cookie and un-serialize it back to the array. tedd -- -------------------------------------------------------------------------------- http://sperling.comAre there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope!<?php $o = new StdObject; $a = array(); $i = 1; $b = false; echo serialize($o),"\n",serialize($a),"\n", serialize($i),"\n", serialize($b),"\n", serialize(array("A"=>$o,"B"=>$a,"C"=>$i,"D"=>$b)),"\n",?> ... and yes there are uses for it. what do you want to do?