Re: metar decoding
| From: | Richard Lynch | Date: | Mon, 12 May 2003 09:32:05 +0000 |
| Subject: | Re: metar decoding | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147277@lists.php.net to get a copy of this message | ||
Steve M wrote:
That's in the right general direction, but it's not quite that simple as the length of the line and the number of elements varies. In the example Bryan gave: KSFF 091753Z 06008G18KT 10SM SCT090 SCT200 16/01 A3000 RMK AO2 SLP158 There are two layers of scattered cloud at 9000ft and 20,000ft, but thereI'd still rather use explode and then deal with the dynamic elements using, say, http://php.net/strtok than have to futz around for weeks trying to find the right Regex... Regex to me always looks like a cat died on the keyboard. :-) Once you pull out the static elements, it's usually not that hard to isolate and loop through the dynamic ones.