I just have a simple for loop, however I keep getting this error and I cannot figure out what is wrong with the loop. I have researched the error and it is most likely a missing semi-colon or parentheses etc. Something simple…
for ($t=1; $t<=16; ++$t)
{
$game$t = $_POST["game$t"];
}
The problem is that you did not look up the manual page for the feature that you’re trying to use. Something simple, indeed.
I think you’re looking for
${game.$t}(not$game$t) in order to create a “family of variables” whose names all share a common prefix:But I’d really suggest that you use an array instead: