Ok! I got 5 variables, $option1, $option2 etc.. I want to do the same sort of thing on each variable, so thought I would use a while loop. So I tried the following.
while ($count <= 5) {
$optionx = '$option' . $count;
if ($optionx == true) {
// code
}
$count++;
}
However while wondering why this didn't work I put
echo "OptionX = $optionx"; and it printed OptionX = $option1not the value of option1 which I was hoping.
![]()
Hopefully you can see what I want to do and what the problem is, any help / tips would appricated.



not the value of option1 which I was hoping.


Bookmarks