Based on the following assumptions (which may not be true), that is exactly what I'm looking for. Assuming:
1. It is faster to load all of the user preferences into a session variable at log in rather than querying the database each time a preference is needed.
2. It is more logical to store all of the user preferences in a single (array) variable than to have 30-40 individual session variables floating around.
Considering that there are no session variables as such but a $_SESSION array, I would say that they're not really floating around. You can - as a matter of personal choice and coding comfort - choose to put the user preferences into an array and than store that array in the $_SESSION array. I don't think PHP puts a penalty on that.
Originally Posted by lightnb
Can you also use that syntax to put an array inside of an array? such as: