Array
(
[0] => stdClass Object
(
[fullname] => sample student
[nickname] => sample
[photo_ids] => |453
[gender] => MALE
[nationality] => KOREAN
)
[1] => stdClass Object
(
[fullname] => kim namkyun
[nickname] => tristan
[photo_ids] => |448
[gender] => MALE
[nationality] => KOREAN
)
)
I have this array
and I wanted to get the name and value using foreach
loop. BUT instead of getting the fullname
and sample student
for example. I get the 0
and the 1
, This is the result from result()
return in mysql
.
My attempt:
$data->param_students = $this->student_model->getItems(array('status'=>'APPROVED'),array('fullname','nickname','photo_ids','gender','nationality'));
foreach ($data->param_students as $key=>$value) {
print_r($key);
}