Re: PHP Weather 2.1.2
Brought to you by:
iridium
|
From: Dan M. <da...@da...> - 2003-05-12 16:58:14
|
I have figured out after struggling a bit how to pull most of the
information in 2.1.2, but I am still having difficulties pulling
"Clouds" and "Weather." I know that the information is in an array, but
I am unclear on how to bring it out of the array.
I also cannot seem to pull wind direction (SW, NW, W), but I can pull
the compass degree (135, 90, 110).
Here is the code:
$weather = new phpweather();
$icons = new pw_images($weather);
$location = $weather->get_location();
$image = $icons->get_sky_image();
$data = $weather->decode_metar();
$temp = $data[temperature];
$windvar = $data[wind]; <-----This Doesn't Work
$cloudvar = $data[clouds]; <-----This Doesn't Work
$time = date("m/d/y g:i a",($data[time]));
$weathervar = $data[weather];
echo "\n";
echo "<div align='center'>
Portland, Oregon<br />
<img src=\"$image\" height='45' width='75' border='0' alt='Current Sky' />";
echo "<br />$weathervar[condition]<br />
</div>";
echo "<b>Temperature:</b> $temp[temp_f]°F<br />";
echo "<b>Humidity:</b> $data[rel_humidity]%<br />";
echo "<b>Wind:</b> $windvar[miles_per_hour]mph<br />
<div align='center'>$time</div>
";
Thank you,
Dan Martin
|