Re: Arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux