[eluser]Zorancho[/eluser]
If you put the array in the session data like that, then you can fetch them like this:
Code:
$sess_data = array(
'one' => 'this is one',
'two' => array('abc', 'this is abc')
);
$this->session->set_userdata($sess_data);
echo '<pre>';
//Print the session userdata
print_r($this->session->all_userdata());
echo '</pre>;
This gives:
Array(
[one] => this is one
[two] => Array
(
[0] => abc
[1] => this is abc
)
);
Which means one is string and two is array... so you can get them individually like this:
Code:
//Fetch each from the session userdata
$one = $this->session->userdata('one');
$two = $this->session->userdata('two');
//This is how you access their values
echo $one .'<br/>';
echo $two[0] .'<br/>';
echo $two[1];
This prints:
this is one
abc
this is abc
You can also make for and foreach loops through the two array and get the values as well.
Hope this helps