]
To: Hugh Danaher [EMAIL PROTECTED]
Sent: Monday, August 06, 2001 5:41 PM
Subject: Re: [PHP] How do I write a compound variable?
To make your code work use curly braces for the compound variables.
http://www.php.net/manual/en/language.variables.variable.php
$high_1995=22;
$high_1996=23
On Tuesday 07 August 2001 01:50, Hugh Danaher wrote:
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
What I want to do:
?php
$high_1995=22;
$high_1996=23;
$high_1997=20;
$high_1998=18;
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
try
for ($year=1995;$year=2001;$year++) {
$high = high_ . $year;
$low = low_ . $year;
printf(avg for %s is %s,$year,($high + $low)/2);
}
on 8/6/01 5:50 PM, Hugh Danaher at [EMAIL PROTECTED] wrote:
I want to do a simple FOR statement where I average the high and low value for
a given
oops, that's printf(avg for %s is %s,$year,($$high + $$low)/2);
:)
sorry
on 8/6/01 6:17 PM, mike cullerton at [EMAIL PROTECTED] wrote:
try
for ($year=1995;$year=2001;$year++) {
$high = high_ . $year;
$low = low_ . $year;
printf(avg for %s is %s,$year,($high + $low)/2);
}
on
5 matches
Mail list logo