Welcome Guest, Not a member yet? Register   Sign In
Multidimensional session data

How is it possible to do the following refactored for CI? Having difficulty compared to the documentation:

1. Increase the value by 1

2. Compare a multidimensional session array key
if ($_SESSION['cart_product_id'][$i] == $product_id) ...

3. Set a session variable using an array key
$_SESSION['cart_product_qty'][] = 1;

4. Display a multidimensional session variable
echo $_SESSION['cart_product_qty'][$i];

I'm not sure if it's possible to use these type of multidimensional session variables??

I don't think it's possible right now in the way you described. It is however possible to serialize whichever arrays you have into a variable, unserialize them when you need them, and again serialize them and put them back in the session.


Theme © iAndrew 2016 - Forum software by © MyBB