PHP 7.1 and raintemptrending script

Hi, all

Is there someone who can help me with this? My server recently upgraded to PHP 7 and i get this warning:

Warning: A non-numeric value encountered in /customers/wxglobalwarming.php on line 311

This is the line in question:
$total_degrees = $total_degrees + ($values[$i]*$days[$i]);
. I have been looking on stackoverflow and the likes but found no solution…

If someone could explain me what to do, i would be very grateful

Staccermaccer AKA Marc,

As one of the values is not initialised correctly try to add the (float) for every variable
Change

$total_degrees = $total_degrees + ($values[$i]*$days[$i]);

to

$total_degrees = (float) $total_degrees + ( (float) $values[$i] *  (float) $days[$i]);

If you only want integers use (int) not (float)

Wim