Hi,
*I need to randomize a multidimensional array so that the order of questions in a questionnaire is different for each participant.
I have limited php skills, and am modifying an old script someone else wrote. Currently, questions are presented in the same order that they are listed in the array. I need them to be presented in a different random order each time. The array is an array made up of other arrays and looks like this:
$original_items = array(
array(1,'stuff','info',response1,'info',response2'),
array(2,'stuff','info',response1,'info',response2'),
array(3,'stuff','info',response1,'info',response2'),
array(4,'stuff','info',response1,'info',response2'),
*I've tried shuffle. It presents random items but I need each item in the array to be presented exactly once. I also have a short randomizing script we used to use, but it makes 1 random order, not a new one each time, e.g. (for an array with 100 items)
//for($count=0; $count<100; $count++){
for($index=100; $index>=0; $index--){
if(count % 2 == 0 && index % 2 == 0){
$temp = $items[$count];
$items[$count] = $items[$index];
$items[$index] = $temp;
}
}
}
Any help appreciated!