RE: Request Help With Output From PHPWEATHER
Brought to you by:
iridium
From: John C. <jo...@ne...> - 2004-04-16 22:00:41
|
It's pretty easy: //You need to include the phpWeather class on your site=20 require_once(FUNCTION_PATH . "phpweather-2.1.2/phpweather.php") //then instantiate a new weather object, $site =3D the ICAO identifier = you want to use $weather =3D new phpweather(array('icao'=3D>$site, 'offset' =3D> '10')); // now that you have an object, get it's data $data =3D $weather -> decode_metar(); // now echo it's temp_f $temp =3D $data['temperature']['temp_f']; Echo $temp; That's untested, but it should work. John Corry > -----Original Message----- > From: php...@li...=20 > [mailto:php...@li...] On=20 > Behalf Of Philip Irvine > Sent: Sunday, April 11, 2004 3:46 AM > To: 'Martin Geisler' > Subject: Request Help With Output From PHPWEATHER >=20 > I do not know PHP and my knowledge of HTML is limited. I=20 > used to program in Fortran and some Assembly Language, but=20 > PHP and HTML are not much like those. >=20 > The PHP WEATHER test page worked fine when I installed the=20 > PHP WEATHER package on the server in=20 > http://www.communitybaptistharvestal.com/phpweather. Thanks=20 > to you and others for creating this complex software package! >=20 > I would like to start PHPWEATHER inside the code for my home=20 > page so that I can insert only the current temperature on my=20 > home page. I need help doing this. >=20 > From file phpweather.txt, temp_f is the current temperature. I added: >=20 > echo temp_f; >=20 > before the ending ?> in phpweather.php as below: >=20 > . > . > . > function tms_unix2date($tmp_tms) { > return gmdate("YmdHis",$tmp_tms); > } > echo temp_f; > ?> >=20 > When I entered > http://www.communitybaptistharvestal.com/phpweather/index.php? > icao=3DKHSV&lang > uage=3Den in the browser, I got:=20 >=20 > Parse error: parse error, expecting `T_OLD_FUNCTION' or=20 > `T_FUNCTION' or `T_VAR' or `'}'' in=20 > /home/pirvine/communitybaptistharvestal-www/phpweather/phpweat her.php on line 101 >=20 > Thanks, > Philip Irvine >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials Free=20 > Linux tutorial presented by Daniel Robbins, President and CEO=20 > of GenToo technologies. Learn everything from fundamentals to=20 > system = administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel >=20 |