Re: Arrays

From: Date: Tue, 09 Nov 2004 08:17:44 +0000
Subject: Re: Arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201594@lists.php.net to get a copy of this message
Zareef Ahmed wrote:
But you need to do serialize and unserialize in case of array or object. Do :: $val_ar=array("one","two","three"); $_SESSION['val_ar_store']=serialize($val_ar);
Serialization is done automatically. You don't need to do it yourself. You can even store simple value-objects in the session witout manual serialization. So you can do: $val_ar = array("one", "two", "three"); $_SESSION['val_ar_store'] = $val_ar; serialize/unserialize are useful if you want to store complex data in a file or in a database.

« previous php.general (#201594) next »