Colleagues.
I have the following code:
$c = 1;
foreach($xml->resultado as $listar => $valor) {
if($_POST["respostas"][$c] == $respostas){
$valor = "1";
$somar = $c;
}else{
$valor = "0";
}
$c++;
}
echo "Valor Total: " .count($c);
The $ value returns 1 for each successful question, so it looks like this:
Resposta A -> 1
Resposta B -> 1
Resposta C -> 1
I would like to add a total of 3, but it is always returning 1.