在我的res3数组中,我没有获取数据。它完全是空白数组。 $ res是我的某个分支受尊重类的结果数组,但是现在我想一次显示所有分支记录,这就是为什么当我检查学生是否在第一个分支中然后在其检查in_array中检查学生是否在foreach循环中使用in_array的原因最终结果返回到$ res3。
$res3=array();
$res2=$this->user_model->all_account_fee_details(['status'=>'pending','amount_due'=>0]);
foreach($res as $key => $row){
if(in_array($row['student_id'],$res2)){
$res3[]=$this->user_model->all_account_fee_details(['student_id'=>$row['student_id'],'status'=>'pending','amount_due'=>0]);
}
}
echo "<pre>";
print_r($res3);