I'm new to PHP and I need to create a quiz using a multidimensional associative array. The quiz prints out like it is supposed to but I am having two issues, one is that I am having trouble trying to make the radio buttons sticky. The other issue is that I want the key "3" to be the answer to all of the questions and I can't seem to figure out a way to count how many times "3" is checked and print out the answer. I've tried a lot of different things over the past 7 hours but nothing seems to work they way I want it to. Do you have any tips or suggestions?
$quiz = array(
"What does HTML stand for?" => array(
'1' => "Home Tool Markup Language",
'2' => "Hyperlinks and Text Markup Language",
'3' => "Hyper Text Markup Language",
'4' => "Hyper Text Manipulation Language",
),
"Choose the correct HTML tag for the smallest heading:" => array(
'2' => "<heading>",
'1' => "<h1>",
'4' => "<head>",
'3' => "<h6>",
),
);
foreach($quiz as $question => $answers) {
echo $question;
echo "<form>";
foreach($answers as $index => $answer) {
echo "<input type='radio' name=$option>".$answer."<br/>";
}
}
?>