sfws wrote:If anyone is interested, I have written in PHP 7 a METAR decoding script that takes into account all the 2017 changes
I changed my decoder to use "pow(base, value)" instead of "base ** value", and changed all my array declarations to use "x = array (value_list)" instead of "x =[value_list]". As a result it is now compatible with PHP 5.4.0 to PHP 7.1.11, but not earlier versions of PHP that do not support PHP constructs like "labels" as these are an essential part of my design.
Currently, the decoding script is in 3 files (easier than a single file to maintain). In the Remarks Group decoding aspects I cover the most widely used codes relating specifically to Australia, Canada, and Italy. I cover 34 out of the 41 USA Remark codes available (and therefore those bases shared with New Zealand and US bases in other nations). I have probably gone further than is reasonable in covering a wide range of possible METAR element combinations, including some misformed content, but my decoder still fails with some codes that either I don't understand, or fall into the "anything in plain English" specification. Although I put a lot of time and mental effort into trying to make the best possible decoder, I have concluded it is not of wider interest, and there is little incentive to continue, especially as my Remarks Group script is still a rather inefficient mess of over 2 thousand lines despite my best efforts!
I have a number of web pages that call my decoder. There is a linked pair; one for selecting a METAR, and one for displaying the selected one. These have helped me to extend my knowledge into such areas as understanding use of 'POST', different ways of designing HTML forms, experimenting with regular expressions, more approaches to validation, and related issues that I did not know that much about, as well as helping me to do more extensive testing of my decoding suite against METAR issued from almost all nations internationally as well as a range of European ones. I don't see these web pages as a polished product that will suit someone else, but they have been successful, in line with their designed purpose, with testing the extremes of what can be done. I also have 3 variants of a Cumulus template to show the decoded output from "Nearest METAR stations" as a series of responsive tables; for a site in the Home Counties around London, UK (contact by PM elicted no response); for a site near London in Canada (compare my http://www.komokaweather.com/metar/metar_display.php
with Saratoga http://www.komokaweather.ca/wxmetar.php
), and the third showing New Zealand plus Antartica (my last challenge was coping with the content of those METAR).