Jump to content

how to append data to variable name


felix822

Recommended Posts

Hello everyone. I have a few variables named in this format - $NameX1 and $NameY1 and so on. They're XY coordinates. I also have a counter variables - $XCounter and $YCounter which will increment in a 'foreach' loop.

 

I'm trying to append the $XCounter to $NameX so in my loop I could call $NameX1, $NameX2, etc. I tried $NameX.$XCounter, but that didn't work. Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/144959-how-to-append-data-to-variable-name/
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.