i want to get data from an array inside of session. i want to get the name of each array. But when i print $x and $y like in the code below, it doesn't print anything
THE ANSWER BEFORE IS CORRECT BUT HOW ABOUT THIS
$this->session->userdata['namearray'];
this is print_r of the session
Array (
[0] => stdClass Object
(
[name] =>a
)
[1] => stdClass Object
(
[name] =>b
)
)
foreach ($this->session->userdata['namearray'] as $x=>$y){
print_r("this is x".$x);
print_r("this is y".$y);
}