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

Was it helpful?

Solution

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

OTHER TIPS

foreach($studentAssProg as $d) : 
    if($d['assignmentID'] == 3)
        echo $d['assProgLevel'];
endforeach;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top