문제

I have create this array:

 $studentAssProg[]=array('studentID'=> $studentID,'assignmentID'=>$assignmentID,'assProgLevel'=>$progress);

what would be the best way to print the progressLevel, for each student where assignmentID = '3' ?

도움이 되었습니까?

해결책

foreach($studentAssProg as $data){
    if($data['assignmentID']==3){
         echo $data['assProgLevel'];
    }
}

다른 팁

foreach($studentAssProg as $d) : 
    if($d['assignmentID'] == 3)
        echo $d['assProgLevel'];
endforeach;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top