I want the new variable, tempvar in this case, to print what i gave it earlier, the color. however it only prints the words holding1 not the value I want it to have, 'green'. I'm sure I'm missing something simple but i apparently have a lack of knowledge in this area.
$holding1="green"; $holding2="blue"; $holding3="yellow"; for ($count = 3; $count >= 1; $count--) { $tempvar=holding . $count; print "$tempvar<br>"; #this prints holding1 instead of green }
In reply to unsure how to use variable by dgoroski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |