1

I am trying to create a simple poll system that allows multiple options to be set and displays the output. This is more theoretical than practical, but I want to be able to check if $optionn is set. For example, in the beginning of the file I declare $option1, $option2, $option3, and $option4. I want a function to be able to check if $option1 is set, then move on and check $option1, $option3, and so on until $optionn is not set, at which point it stops. The trouble is I don't know how to change variables in that way. Is there a way to change the n in $optionn to be, say $x? Like $option"$x" or something.

WD40
  • 429
  • 1
  • 7
  • 19

0 Answers0