I want to do a simple FOR statement where I average the high and low value for a given 
year.  A user will
input the values on a separate page and hit a submit button.  I can hard code each 
year to do what I want, but I'd like a simpler method.  I've tried variations of 
multiple $'s, +'s and quote marks but haven't hit on the correct method, and I could 
certainly use someone's help.


What I want to do:



for ($year=1995;$year<=2001;$year++)
 $avg_$year=($high_$year"+$low_$year)/2   //  create $avg_1995, ...
 print "$avg_$year<br>";


Reply via email to