I’m trying to refer to a variable that’s made up from a string, so say $type = "pistol", then:
if ($number > $($type. "s_XP"))
would be
if ($number > $pistols_XP)
Obviously the top one isnt correct syntax, because I don’t know how it should be written.
Any help?
The correct syntax would be:
However, you should be storing this data in an object instead (or perhaps an array):