Is there a way to take a variable name and combine it with a variable value to make a new variable name?
For example, my client wants to make a questionnaire with multiple questions.
So let's say there are three questions (three variables) created when a user fills out a checkbox form--$Question1, $Question2, and $Question3. Each of these is an array that holds the value for the options selected in that question of the form. If my client wants four questions, then, of course, another variable, $Question4, would be created.
To put the data into the database, I want to step through each of the questions, so I made a for statement. But how do I get the data?
For instance:
for ($i=1;$i<$NumQuestions;$i++){
echo $Question$i // Obviously this won't work, but what will?
}
Thanks for your help!