This is my code this part is row1 i need to count every like and also count neutral from this inputs and display the number of likes and neutrals separately
<tr>
<td>1.</td>
<td style="border-right: 1px solid;"><input type="radio" name="answer1" value="Like" <?php if($answer1=="Like") echo "checked"?> disabled></td>
<td style="border-right: 1px solid;"><input type="radio" name="answer1" value="Neutral" <?php if($answer1=="1Neutral") echo "checked"?> disabled></td>
<td style="border-right: 1px solid;"><input type="radio" name="answer1" value="Dislike" <?php if($answer1=="1Dislike") echo "checked"?> disabled></td>
<td>13.</td>
<td style="border-right: 1px solid;"><input type="radio" name="answer13" value="Like"<?php if($answer13=="Like") echo "checked"?> disabled></td> <!--name="q1"-->
<td style="border-right: 1px solid;"><input type="radio" name="answer13" value="Neutral" <?php if($answer13=="Neutral") echo "checked"?> disabled></td>
<td style="border-right: 1px solid;"><input type="radio" name="answer13" value="Dislike" <?php if($answer13=="Dislike") echo "checked"?> disabled></td>
<td>25.</td>
<td style="border-right: 1px solid;"><input type="radio" name="answer25" value="Like" <?php if($answer25=="Like") echo "checked"?> disabled></td>
<td style="border-right: 1px solid;"><input type="radio" name="answer25" value="Neutral" <?php if($answer25=="Neutral") echo "checked"?> disabled></td>
<td style="border-right: 1px solid;"><input type="radio" name="answer25" value="Dislike" <?php if($answer25=="Dislike") echo "checked"?> disabled></td>
<td style="border-left: 1px solid">R1</td>
and this is my if statement
<?php
$Like = null;
$Neutral = null;
$dislike = null;
$valid = true;
if ($answer1 == 'Like') {
$Like = 'answer 1 L';
$valid = true;
}
if ($answer1 == 'Neutral') {
$Neutral = 'answer 1 N';
$valid = true;
}
if ($answer13 == 'Like') {
$Like = '2';
$valid = true;
}
elseif ($answer13 == 'Neutral') {
$Neutral = 'answer13 N';
$valid = true;
}
if ($answer25 == 'Like') {
$Like = 'answer25 L';
$valid = true;
}
elseif ($answer25 == 'Neutral') {
$Neutral = 'answer 25 N';
$valid = true;
}
?>
<td><?php echo $Like ?></td>
<td><?php echo $Neutral ?></td>
What i need to do is echo every Like from $Like and Neutral from $Neutral.. I don't know if this is the proper way to do this I'm open for suggestions :)