Examples: RA, BR, +TSRA, -DZ...
Anyway, how can I get preg_match() to return all occurances?
The following is a small portion of my code:
Code: Select all
<?php
$metar = "072345Z AUTO 32013G19KT 1 3/4SM -RA BR OVC006 09/09 A2982 RMK AO2 RAE19B41 P0000";
preg_match("/[-?+?][[A-Z]{2}|[A-Z]{4}]/", $metar, $precip);
print_r($precip);
?>Code: Select all
Array (
ї0] => -RA
)Code: Select all
Array (
ї0] => -RA
ї1] => BR
)