I need help with the correct syntax for the following:
$answer = $row[$variable];
Normally, you would type something like:
$answer = $row['whatever'];
But I want to use a variable in place of the string 'whatever'
Thanks!
You've got it. $answer = $row[$variable];
Using single quotes around a variable key would tell php to not parse the variable, and wouldn't return what you wanted.
Ok, I'll play with it. For some reason it wasn't working... I'll try it again.
It was a problem with my variable value, not the code... 😛
Thanks for your help 🙂