Re: Problem when there's no dew-point
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2003-06-14 23:41:56
|
Tom McDonald <to...@un...> writes: > Ahhhh I see. So it's a bug with PHPWeather's handling of the METAR feed. Oh no, a bug?! :-) I believe I've fixed this now with this very simple fix around line 447 in phpweather.php: - } elseif (ereg('^(M?[0-9]{2})/(M?[0-9]{2})?$', $part, $regs)) { + } elseif (ereg('^(M?[0-9]{2})/(M?[0-9]{2}|//)?$', $part, $regs)) { ... - if (!empty($regs[2])) { + if (!empty($regs[2]) && $regs[2] != '//') { It simply makes the 'xx///'-case the same as the 'xx/'-case that PhpWeather already handles. > Interesting that the UK have different METAR coding rules than > everyone else. You'd have expected ICAO to have standardised it > all. Though I guess getting everyone to agree on something might be > a tad optimistic ;) Yes, this doesn't make things any easier for projects like this one... Thanks (to both of you) for pointing this out. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |