Sessions and Arrays

From: Date: Sun, 19 May 2002 20:31:54 +0000
Subject: Sessions and Arrays
Groups: php.general 
Request: Send a blank email to php-general+get-98382@lists.php.net to get a copy of this message
Hello Everyone, How do I send a single array, with many values, through sessions? For example, I might have the following: <?php session_start(); session_register("product"); $product['category'] = "appetizer"; $product['name'] = "Miso Soup"; $product['desc'] = "Some Description"; $product['price'] = "4.95"; ?> By registering just the "product" array, will I have all of the values of that array available to me throughout the entire session? Or will I have to register each array variable-value pair separately, like so: session_register("product['category']", "product['name']", "product['description']", "product['price']", ); Any help and suggestions on sending arrays through sessions will be greatful, thanks! :)

« previous php.general (#98382) next »