我有一些代码可以生成其中包含对象的数组,并且我想访问对象值。
$results = array();
$std_arr = array();
$data['examlist'] = $this->exam_model->get($exam);
foreach ($student_array as $key => $value) {
$std_arr[] = $value->student_id;
$results[] = $this->student_model->get_single_student_result($value->student_id);
}
当我记录结果时,我得到
Array
(
[0] => Array
(
[0] => stdClass Object
(
[exam_schedule_id] => 14
[get_marks] => 23.00
[id] => 1
[exam_id] => 1
[teacher_subject_id] => 1
[name] => GEO
[teacher_id] => 16
[subject_id] => 1
[code] => Geography
)
)
[1] => Array
(
[0] => stdClass Object
(
[exam_schedule_id] => 14
[get_marks] => 0.00
[id] => 1
[exam_id] => 1
[teacher_subject_id] => 1
[name] => GEO
[teacher_id] => 16
[subject_id] => 1
[code] => Geography
)
如何访问这些“ stdClass对象”属性?