Branching blunder
| From: | Alex Hogan | Date: | Thu, 05 Aug 2004 14:02:11 +0000 |
| Subject: | Branching blunder | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192859@lists.php.net to get a copy of this message | ||
Hi All,
I have a branching statement that looks for the last two answers in a
multiple choice question and checks to see if they're either 'All of the
above' or 'None of the above'.
if($ans_three[$qzid] === 'None of the above' || $ans_three[$qzid] ===
'All of the above'){
if($ans_four[$qzid] === 'None of the above' || $ans_four[$qzid] ===
'All of the above'){
$answers = rand(6,8);
}
$answers = 5;
}
else{
$answers = rand(1,4);
}
However when I run it, it checks everything correctly until it has
answer three and four having 'All of the above' and 'None of the above',
then it branches to $answer = 5, only. Why?
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************