setLocationByCookie()) { $weather->setLocationByUserIP(); } $weather->loadForecast(); $tempunits = "C"; $degreesymbol = "°"; if (!empty($_COOKIE['TemperatureUnitsPref']) && preg_match("/[FCK]/", $_COOKIE['TemperatureUnitsPref'])) { $tempunits = $_COOKIE['TemperatureUnitsPref']; // No degree symbol for Kelvins if ($tempunits == "K") { $degreesymbol = ""; } } ?>
getCurrently(); $forecast = $weather->getForecast(); ?>

summary; ?>

build("{temp}{units}", ["temp" => round(Weather::convertDegCToUnits($currently->temperature, $tempunits), 1), "units" => " $degreesymbol$tempunits"]); ?>

build("Low: {tempLow}{units} High: {tempHigh}{units}", [ "tempLow" => round(Weather::convertDegCToUnits($forecast[0]->tempLow, $tempunits), 1), "tempHigh" => round(Weather::convertDegCToUnits($forecast[0]->tempHigh, $tempunits), 1), "units" => " $degreesymbol$tempunits" ]); ?>

summary; ?>

= 7) { break; } $i++; ?>
time); ?>

build("{tempLow} to {tempHigh}{units}", [ "tempLow" => round(Weather::convertDegCToUnits($day->tempLow, $tempunits), 1), "tempHigh" => round(Weather::convertDegCToUnits($day->tempHigh, $tempunits), 1), "units" => " $degreesymbol$tempunits" ]); ?>

summary; ?>

F | C | K
getLocationName())) { echo htmlentities($weather->getLocationName()) . " | "; } echo round($weather->getLatitude(), 2) . ", " . round($weather->getLongitude(), 2); ?> get("Geolocate"); ?>