Re: Using PHPWeather question
Brought to you by:
iridium
From: Daisyhead <je...@da...> - 2004-02-18 04:19:06
|
I don't think I'm explaining myself very clear on what I want my weather to look like. I want a simple list, without the whole paragraph text. Something that look like this: Temp: Feels like: Conditions: Wind: Humidity: Dewpoint: Pressure: Visibility: And this is the code I"m trying to tweak to get the information to be listed as above: <?php require('/home/xxx/public_html/weather/phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); $foo = $weather->decode_metar(); $temp_c = $foo['temperature']['temp_c']; $temp_f = $foo['temperature']['temp_f']; $miles_per_hour = $foo['wind']['miles_per_hour']; $dew_point = $foo['dew-point']['dew_point']; $visibility_less_than = $foo['visibility']['visibility_less_than']; $feelslike = $foo['feelslike']['feelslike']; $weather = $foo['weather']['weather']; $rel_humidity = $foo['rel_humidity']['rel_humidity']; $altimeter = $foo['altimeter']['altimeter']; echo "Temp: $temp_f ° Fahrenheit<br>"; echo "Feels like: $feelslike<br>"; echo "Conditions: $weather<br>"; echo "Wind: $miles_per_hour MPH<br>"; echo "Humidity: $rel_humidity %<br>"; echo "Dewpoint: $dew_point<br>"; echo "Pressure: $altimeter<br>"; echo "Visibility: $visibility_less_than"; ?> Is there any way to list out the output instead of having it in paragraph format? Thank you, Jenni ----- Original Message ----- From: "Max Hammond" <ma...@fl...> To: "Daisyhead" <je...@da...>; <php...@li...> Sent: Tuesday, February 10, 2004 2:28 AM Subject: RE: Using PHPWeather question > > errr bad HTML on my part. > > > <?php > > // first of all, set up the decoder > require('phpweather.php'); > $weather = new phpweather(); > $weather->set_icao("KOMA"); > > // next, the text parsing > require('output/pw_text_en.php'); > $text = new pw_text_en($weather); > echo $text->print_pretty(); > > echo '<br />'; > > // now, images > require('output/pw_images.php'); > $icons = new pw_images($weather); > echo '<img src="' . $icons->get_sky_image() . > '" height="50" width="80" border="1" alt="Current weather in ' . > $weather->get_location() . '" /> ' . > '<img src="' . $icons->get_winddir_image() . > '" height="40" width="40" border="1" alt="Current wind in ' . > $weather->get_location() . '" /> ' . > '<img src="' . $icons->get_temp_image() .'" />'; > ?> > > is better :) > > max > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > > |