What is the best practice for storing and managing multiple answer options for questions in PHP?
When storing and managing multiple answer options for questions in PHP, it is best to use an array to store the options. This allows for easy manipulation and retrieval of the answer options. Additionally, using a loop to iterate through the array can help in displaying the answer options in a user-friendly manner.
// Sample code to store and manage multiple answer options for a question
$question = "What is the capital of France?";
$answerOptions = ["A) London", "B) Paris", "C) Berlin", "D) Rome"];
// Display the question
echo $question . "\n";
// Display the answer options
foreach ($answerOptions as $option) {
echo $option . "\n";
}