Array into a session variable

Hi,

Im having problems using session




$var = array(

'23' => array('var1' => 'something', 'var2' => 'something more'),

'42' => array('var1' => 'something', 'var2' => 'something more'),

);

Yii::app()->session['myArray'] = $var;



when y use print_r against Yii::app()->session[‘myArray’] y get





0 => array(var1 => something, var2 => something more)

1 => .....



Why the index of the original array are not in the session array?

I need this to make a shoping cart…

Thanks

Are you sure, coz I’ve copied your coding and run on my computer it output correctly. Result on my pc:


array

  23 => 

    array

      'var1' => string 'something' (length=9)

      'var2' => string 'something more' (length=14)

  42 => 

    array

      'var1' => string 'something' (length=9)

      'var2' => string 'something more' (length=14)



well, my fault. Obviostly, the code works well, was doing the wrong tests…

Thanks for the quick reply!