Is there a way to control a dynamic value within a variable.
For example, if I have a variable called:
$myvariable1answer1
And all I want to change is the number 1 in the variable, how do I go about doing that. I tried using a for loop but that did not work:
for ($i = 1; $i <= 100; $i++) {
$newvar[$i] = $myvariable[$i]answer[$i];
}
So if I echo say $newvar[22], the value I am looking for is $myvariable22answer22.
With the above code I got a parse error, If I put quotes around this line:
$newvar[$i] = "$myvariable[$i]answer[$i]";
And then do an echo of $newvar[$i] I get: answer22
Thanks for any help.