Jump to content

Variable Variables


bschultz

Recommended Posts

I'm have a hard time figuring out variable variables.

 

if (${$pos_$i} == '1234')

 

So, the $i is in a loop...

 

The full variables are $pos_1, $pos_2, $pos_3 etc.

 

How can get this to work?  The code above throws a Parse error: syntax error, unexpected T_VARIABLE in... error.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/283868-variable-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.