如何在PHP中的foreach循環中合併數組?如何在foreach循環中合併數組?
這裏是我的代碼:
$subjects = $this->db->order_by('id','desc')->get_where('tbl_class_management', array('status'=>'1','teacher_id'=>$this->teacher->id))->result();
foreach ($subjects as $key => $s) {
$std = $this->db->get_where('tbl_student', array('batch'=>$s->batch,'semester'=>$s->semester,'faculty'=>$s->faculty))->result();
debug($std);
}
要合併哪個數組? –
您是否想要將所有數據存儲在$ std數組中? –
要合併的數組在哪裏= ???? – scaisEdge