Question

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' ?

Était-ce utile?

La solution

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

Autres conseils

foreach($studentAssProg as $d) : 
    if($d['assignmentID'] == 3)
        echo $d['assProgLevel'];
endforeach;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top