title: Count the instances where a variable equals TRUE
body: <p>Working on a quiz website where when users submits their answers <code>$perQuestionScore</code> equals <code>true</code> when the answer is correct but <code>false</code> when it is wrong. I'm trying to find the instances where <code>$perQuestionScore</code> equals true in other to total the score but it doesn't seem to work. </p>
  
  <p>My code looks like below</p>
  
  <pre><code>   &lt;?php    
  
  $perQuestionScore = 0;
  
  if (isset($_POST['grader'])) {
  
  if(isset($_POST[$chosen]))
  
  {
          $choice= $_POST[$chosen];
  
      if (strpos($choice, $correctOne) !== false) {
  
          $perQuestionScore++;
  
      echo $_POST[$chosen] . "" . " is the correct answer";
  
  } elseif (strpos($choice, $correctOne) == false) { echo $_POST[$chosen] . "" . " is the Wrong answer";
  
  } else  {
  
  echo "You did not choose an answer"; { 
  
  
  
  }
  }
  }               
  }
       }
       echo "&lt;input id=grader' type='submit' name='grader' value='Grade Quiz'&gt;" . "&lt;/form&gt;";
                      echo $perQuestionScore * 10;
  
  } 
  
  
  
  
  
  $conn-&gt;close();
  ?&gt; 
  </code></pre>