In a loop I needed to create / lookup variables that end with a numeric increment. What I found was I can use the following:
1 2 3 4 5 |
for ($x = 1; $x <= 10; $x++) { if (${'variableName'.$x} !='') { echo(${'quantQ'.$x}); } } |
In a loop I needed to create / lookup variables that end with a numeric increment. What I found was I can use the following:
1 2 3 4 5 |
for ($x = 1; $x <= 10; $x++) { if (${'variableName'.$x} !='') { echo(${'quantQ'.$x}); } } |