Home › Forums › Back End › How to shuffle questions using php? › Reply To: How to shuffle questions using php?
September 10, 2013 at 10:29 am
#149659
Migotn
Participant
ahlertjrs,
In php, one of the options would be to store the questions in an array and the use shuffle() function to assist in doing what you trying to achieve.
<?php
$question_array = array("Qa","Qb","Qc","Qd","Qe");
//Shuffle the array of questions
shuffle($question_array);
//print out the arrays to your screen or you may opt to save them yet to another array or variable for later use
print_r($question_array);
?>