| =$location["name"]?> (=$search?>) |
Sunrise: =$location["sunrise"]?> |
Sunset: =$location["sunset"]?> |
|
|
| Temperature: =round($weather["temperature"], 1).$units["temp"]?> |
Dew point: =round($weather["dewPoint"], 1).$units["temp"]?> |
Felt temperature: =round($weather["feltTemperature"], 1).$units["temp"]?> |
Trend:
$val) {
switch ($key) {
case "type":
switch ($val) {
case "NOSIG":
$string = "No Significant Weather";
break;
case "TEMPO":
$string = "Temporary Weather";
break;
case "BECMG":
$string = "Weather Becoming";
break;
}
$value = "";
foreach (array("from", "to", "at") as $time) {
if (isset($trend[$time])) {
$value .= " ".$time." ".$trend[$time];
}
}
($value != "") ? $value = trim($value).":":"";
$string = ''.$string.'';
$value = ''.$value.'';
break;
case "wind":
$string = "Wind:";
$value = (strtolower($trend["windDirection"]) == "calm") ? "Calm" : "From the ".$trend["windDirection"]." (".$trend["windDegrees"]."°) at ".round($trend["wind"], 1).$units["wind"];
if (isset($trend["windVariability"])) {
$value .= ", variable from ".$trend["windVariability"]["from"]."° to ".$trend["windVariability"]["to"]."°";
}
if (isset($trend["windGust"])) {
$value .= ", with gusts up to ".round($trend["windGust"], 1).$units["wind"];
}
break;
case "visibility":
$string = "Visibility:";
$value = strtolower($trend["visQualifier"])." ".round($trend["visibility"], 1).$units["vis"];
break;
case "clouds":
$string = "Clouds:";
$value = "";
for ($i = 0; $i < sizeof($val); $i++) {
$cloud = ucwords($val[$i]["amount"]);
if (isset($val[$i]["type"])) {
$cloud .= " ".$val[$i]["type"];
}
if (isset($val[$i]["height"])) {
$cloud .= " at ".$val[$i]["height"].$units["height"];
}
$value .= $cloud." ";
}
break;
case "condition":
$string = "Condition:";
$value = ucwords($val);
break;
case "pressure":
$string = "Pressure:";
$value = round($val, 1).$units["pres"];
break;
case "from":
case "to":
case "at":
case "windDirection":
case "windDegrees":
case "windVariability":
case "windGust":
case "visQualifier":
continue 2;
default:
$string = ""; $value = "";
var_dump($key, $val);
break;
}
?>
=$string?> =$value?>
none
Remarks:
$val) {
switch ($key) {
case "autostation":
case "presschg":
case "nospeci":
case "sunduration":
case "maintain":
$string = "";
$value = $val;
break;
case "seapressure":
$string = "Pressure at sealevel:";
$value = round($val, 1).$units["pres"];
break;
case "1htemp":
$string = "Temperature for last hour:";
$value = round($val, 1).$units["temp"];
break;
case "1hdew":
$string = "Dew Point for last hour:";
$value = round($val, 1).$units["temp"];
break;
case "6hmaxtemp":
case "6hmintemp":
if (!isset($weather["remark"]["6hmaxtemp"]) && !isset($weather["remark"]["6hmintemp"])) {
continue(2);
}
$string = "Max/Min Temp for last 6 hours:";
$value = (isset($weather["remark"]["6hmaxtemp"])) ? round($weather["remark"]["6hmaxtemp"], 1).$units["temp"] : "-";
$value .= "/";
$value .= (isset($weather["remark"]["6hmintemp"])) ? round($weather["remark"]["6hmintemp"], 1).$units["temp"] : "-";
unset($weather["remark"]["6hmaxtemp"]); unset($weather["remark"]["6hmintemp"]);
break;
case "24hmaxtemp":
case "24hmintemp":
if (!isset($weather["remark"]["24hmaxtemp"]) && !isset($weather["remark"]["24hmintemp"])) {
continue(2);
}
$string = "Max/Min Temp for last 24 hours:";
$value = (isset($weather["remark"]["24hmaxtemp"])) ? round($weather["remark"]["24hmaxtemp"], 1).$units["temp"] : "-";
$value .= "/";
$value .= (isset($weather["remark"]["24hmintemp"])) ? round($weather["remark"]["24hmintemp"], 1).$units["temp"] : "-";
unset($weather["remark"]["24hmaxtemp"]); unset($weather["remark"]["24hmintemp"]);
break;
case "snowdepth":
$string = "Snow depth:";
$value = $val.$units["rain"];
break;
case "snowequiv":
$string = "Water equivalent of snow:";
$value = $val.$units["rain"];
break;
case "sensors":
$string = "";
$value = implode(" ", $val);
break;
default:
$string = ""; $value = "";
var_dump($key, $val);
break;
}
?>
=$string?> =$value?>
none
|
| Pressure: =round($weather["pressure"], 1).$units["pres"]?> |
Humidity: =round($weather["humidity"], 2)?>% |
Wind: =strtolower($weather["windDirection"]) == "calm" ? "Calm" : "From the ".$weather["windDirection"]." (".$weather["windDegrees"]."°) at ".round($weather["wind"], 1).$units["wind"]?>
=isset($weather["windVariability"]) ? " variable from ".$weather["windVariability"]["from"]."° to ".$weather["windVariability"]["to"]."°" : ""?>
=isset($weather["windGust"]) ? " with gusts up to ".round($weather["windGust"], 1).$units["wind"] : ""?>
|
Visibility: =strtolower($weather["visQualifier"])?> =round($weather["visibility"], 1).$units["vis"]?> |
Current condition: =isset($weather["condition"]) ? ucwords($weather["condition"]) : "No Significant Weather"?> |
" src="images/32x32/=$weather["conditionIcon"]?>.png"> |
Precipitation:
=$precip?>
Clouds:
=$cloud?>
Clear Below =$metar->convertDistance(12000, "ft", $units["height"]).$units["height"]?>
|