bschultz Posted April 26, 2012 Share Posted April 26, 2012 I need to use a variable variable. I need: $row['pos_1'] $row['pos_2'] to use $i for the numbers I have this: if ($row{[pos_.$i]} == 'ad') which is throwing an error Parse error: syntax error, unexpected '[' Any ideas? Thanks! Link to comment https://forums.phpfreaks.com/topic/261616-need-help-with-variable-variables/ Share on other sites More sharing options...
KevinM1 Posted April 26, 2012 Share Posted April 26, 2012 $row['pos_' . $i] is what you're looking for. Link to comment https://forums.phpfreaks.com/topic/261616-need-help-with-variable-variables/#findComment-1340577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.