我创建了这个数组:
$studentAssProg[]=array('studentID'=> $studentID,'assignmentID'=>$assignmentID,'assProgLevel'=>$progress);
打印progressLevel的最佳方法是什么,对于assignID =' 3' ?
答案 0 :(得分:1)
foreach($studentAssProg as $data){
if($data['assignmentID']==3){
echo $data['assProgLevel'];
}
}
答案 1 :(得分:0)
foreach($studentAssProg as $d) :
if($d['assignmentID'] == 3)
echo $d['assProgLevel'];
endforeach;