I have variables called preConSA1, preConSA2, preConSA3 and preConSA4. Each can have an integer value of from 1 to 4. What I'd like to do is loop through the values like this:
if ($preConSAx = 1) {
$preConSAx = $preConFirstChoice;
} else if (preConSAx = 2) {
$preConSAx = $preConSecondChoice;
} else if (preConSAx = 3) {
$preConSAx = $preConThirdChoice;
} else if (preConSAx = 4) {
$preConSAx = $preConFourthChoice;
}
I'm not even sure I've written the pseudo code right, but basically, what I'm trying to do is find a short-cut way to assign each of the 4 preConSA variables to its respective choice variable. I could do it the long way -- just writing the code block out 4 times -- one for each variable. But I figured there was a more eloquant way to do it. Anyone?