Beau,
I think you may have a misunderstanding of the role the variables named in a function definition actually do.
In the line
Code: Select all
function CU_CBI($inTemp,$inTempUOM,$inHumidity) {
the CU_CBI function has three arguments with symbolic names (used ONLY inside the function itself) of $inTemp,$inTempUOM,$inHumidity . When the function is actually called (earlier in the CU-defs.php script by
Code: Select all
list($chandler,$chandlertxt,$chandlerimg) = CU_CBI($temperature,$uomtemp,$humidity);
The current value of $temperature is assigned to the function's $inTemp variable, the value of $uomtemp is assigned to the function's $inTempUOM variable, and the value of $humidity is assigned to the function's $inHumidity variable.
The assignments for $temperature,$uomtemp,$humidity happen further up the CU-defs.php source at
Code: Select all
$uomtemp = $WX['tempunit'];
$temperature = $WX['temp'];
$humidity = $WX['hum'];
So the function is really calculating the CBI based on the outside temperature and unit-of-measure and outside relative humidity.
Using functions allow you to isolate calculations and pass information to the function from different sources. The function definition statement just serves to declare the function name, and the internal(to the function) variable names that will receive argument values when the function is called.
Best regards,
Ken