I think that variable variable should somehow be able to solve my problem ... but I can not seem to make it work.
I have variables that end in a number. For instance:
$variable1
$variable2
$variable3
The variables are all named the same except for the number suffix. I am trying to find a way to define the number and call the variables using variables. I know this code will not work, but this hopefully illustrates what I am trying to do.
$variable3 = "I hope this displays";
$number = "3";
$displaythisvariable = "variable" . "$number";
echo "$displaythisvariable";
The output would hopefully be:
I hope this displays
Can anyone think of a way to do this?