this will probably open up a big can of worms here but i would suggest a very different data structure.
2 tables: questions and answers
questions
question_id (INT) PK
text (VARCHAR)
answers
answer_id (INT) PK
question_id (INT)
text (VARCHAR)
correct (BOOL) true for correct / false for incorrect
sample code for getting the Q&A's (assuming mySQL):
<?php
// connect to db here
$result = mysql_query('SELECT * FROM questions ORDER BY question_id') or exit(mysql_error());
while ($row = mysql_fetch_assoc($result)) {$questions[$row['question_id']] = $row['text'];}
$result = mysql_query('SELECT * FROM answers ORDER BY RAND()') or exit(mysql_error());
while ($row = mysql_fetch_assoc($result)) {$answers[$row['question_id']][$row['answer_id']] = $row['text'];}
echo '<form action="" method="POST">';
foreach ($questions as $key => $value)
{
echo 'Q: ' . $value['text'] . '<br>';
foreach ($answers[$key] as $subkey => $subvalue)
{
echo '<input type="radio" name="answers[' . $key . ']" value="' . $subkey . '">' . $subvalue . '<br>';
}
echo '<hr>';
}
echo '
<input type="submit" name="submit" value="submit">
</form>
';
?>
then in your form processing code you will have an array called $_POST['answers'] with the question_id's as the keys and the answers_id's as the values. you just then need to query the db to see if the answers are correct.