Aaron
Aaron

Reputation: 329

How can I use multidimensional arrays in PHP with MySQL-based sessions?

So I started using MySQL-based sessions with session_module_name("user"); and I love it, and I might as well because I have to.

The only thing I'm missing are my beloved multidimensional arrays, and I'm at a juncture where they are most desired. How can I still use them, or is it a lost cause?

Upvotes: 1

Views: 360

Answers (1)

Ben Rowe
Ben Rowe

Reputation: 28691

use seralize() method to convert your array data into a string representation (which is easily stored in a db). When you retrieve the data back from the db, use unseralize().

Upvotes: 1

Related Questions