riccardo cabassi <[EMAIL PROTECTED]> writes:

> After having successfully tested phpweather on my localhost, I found
> out that wind directions were not decoded on the server I am hosted.
> I presume this depends on using different PHP releases.

That's strange - the round() function ought to return an integer...

What version of PHP are you using on your localhost, and on your
remote host?

> Anyway, here a the bug fix:
> 
> /* old code */ 
> $wind_dir_text_array[round($regs[1]/22.5];
> $decoded_metar['wind_dir_text_short'] =
> $wind_dir_text_short_array[round($regs[1]/22.5];
> 
> /* new code */
> $ind = intval(round($regs[1]/22.5));
> $decoded_metar['wind_dir_text'] = wind_dir_text_array[$ind];
> $decoded_metar['wind_dir_text_short'] =
> $wind_dir_text_short_array[$ind];
> 
> Kind regards
>       
>       Riccardo Cabassi
> _____________________________________________
>         Cabassi Riccardo
>         via Migliara, 47 - 42034 Casina (RE)
>         E-mail: [EMAIL PROTECTED]
>         Home page: http://www.mastercab.it
>         tel.: 0522 604407  /  0339 3481120
> 

-- 
Best regards,
Martin Geisler

Checkout http://www.gimpster.com for:
PHP Weather => Shows the current weather on your webpages.
PHP Shell   => A telnet-connection (almost :-) in a PHP page.
  • Bug fix riccardo cabassi
    • Martin Geisler

Reply via email to