Pregunta

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

¿Fue útil?

Solución

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

Otros consejos

foreach($studentAssProg as $d) : 
    if($d['assignmentID'] == 3)
        echo $d['assProgLevel'];
endforeach;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top