Hopefully someone can help!
I successfully completed over the weekend my quiz which was a 10 question / multiple choice / multiple answer type scenario - however the brief changed this morning -
It turns out that Question 1 for example:
Q How do you make tea
A) Water
B) Teabag
C) Cup
D) Fish Tank
The client would like it that while A B C are the correct answers, there are other correct answers for example: -
A - Is correct + 1 to score
B - Is correct + 1 to score
C - Is Correct + 1 to score
A & B - Is correct + 1 to score
A & C - Is correct + 1 to score
B & A - Is correct + 1 to score
B & C - Is correct + 1 to score
A & B & C - Is the Jackpot! + 1 to score
Before this 'amendment' I had stored the results into the Database for Question as A,B,C - so everything was working - so I believe I have to 'explode' the original array so they are individual array elements (I was assuming it would be easier to do it this way) - So my array now looks like this:
Array ( [0] => A [1] => B [2] => C )
I tried to do a if nested if statement:
if($vex['0'] == 'A')
{
echo "Yup, it equals A";
if($vex['1'] == 'B')
{
echo "Yup, it equals B";
}
But I realised that the array might not always start with [0] => A etc.
Could help me and point me in the right direction?
Would it simpler for me to store the checkboxes as single values rather than an array and just do a check?