$peopleNum){ if(!array_key_exists((int)$peopleNum,$getPoint)){ $getPoint[(int)$peopleNum]=(int)$quizPoint[$key]; }elseif(array_key_exists((int)$peopleNum,$getPoint)){ $getPoint[(int)$peopleNum]=$getPoint[(int)$peopleNum]+(int)$quizPoint[$key]; } } if(max($getPoint)==$getPoint[0]){ echo "YES"; }else{ echo "NO"; }