Hi Martin (and others),
The script you sent me worked fine! It prints the pretty string as it is
intended to.
I had to modify one line though: the script produces a warning:
Warning: Variable used in global statement already exists in the function in
phpweather.inc on line 486
I found that by uncommenting the $useXML; variable in line 486, the
warning disappears.
I have two other questions, but i will ask them in another thread.
Thanks again!
Ray
>From: Martin Geisler <gim...@gi...>
>To: php...@li...
>Subject: Re: (no subject)
>Date: Tue, 05 Feb 2002 00:27:33 +0100
>
>"Ray van Beek" <r_v...@ho...> writes:
>
> >>(By the way: please subscribe to the list - postings from
> >>non-subscribed addresses are held for approval until I either
> >>approve them or rejects them.)
> >>
> >
> > I did yesterday, hopefully, things go better now..
>
>Yes, your mails are getting through now - great :-)
>
> > Yes, that works fine with me... I know this must work in php, but on
> > the other hand, why does the construction not work in the phpweather
> > script I have.
>
>I've just realized, that the trick employed above with $GLOBALS won't
>work, as we're not interested in getting the variables into the global
>scope, but rather into the /local/ scope. Global variables are not
>visible in the local scope of a function, unless it has been declared
>using the 'global' keyword...
>
>I don't think it's possible to get the variables into the local scope
>by calling a function...
>
>What we can do, is to stop using extract. It's actually only used two
>times in phpweather.inc. And str_replace is only used once, so that
>can be removed as well, so that should make PHP Weather compatible
>with PHP version 3.0.3 - I hope :-)
>
>I've attached a new phpweather.inc - please try it out and tell me if
>it works on your system. I experienced some strange errors with the
>temperature and dewpoint for Thule AB - the temperature information
>was present in the METAR, but it was parsed as a comment... very
>strange. The offending METAR was:
>
> BGTL 041855Z 09005KT 6000 -SN BR FEW010 SCT035 OVC050 M23/M23
> A2970 RMK SLP073 ESTMD WND 8/5// 9/8// PSR13
>
><< phpweather.inc >>
>
>--
>Martin Geisler My GnuPG Key: 0xF7F6B57B
>
>See my homepage at http://www.gimpster.com/ for:
>PHP Weather => Shows the current weather on your webpage.
>PHP Shell => A telnet-connection (almost :-) in a PHP page.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
|