| Index | PHPmyEasyWeather | PHPmyEasyWeather Homepage |
getClouds -- return several sky / cloud information out of METAR or TAF Code
Array getClouds (string $METAR_TAF, int $CLOUDLAYER, string $LANGUAGE);
getClouds returns information about the sky / cloud coverage for the given cloud layer. It expects the number of the inquired layer as an integer ($CLOUDLAYER) starting from 0 (for the 1st cloud layer). The 3rd parameter $LANGUAGE is expected either as "EN" ("en") for english or "DE" ("de") for german. Other languages are currently not provided. If a specified layer is not quoted in $METAR_TAF or the METAR or TAF code is incorrect getClouds will return false.
getClouds returns an array with 6 elements and the following indexes:
Example:
<?
include ("phpmyeasyweather.inc.php"); $METAR = "GCRR 281200Z 31011KT 8000 FEW030 BKN400TCU 20/16 A3016 NOSIG"; $cloudlayer = 0;
while ($clouds = getClouds ($METAR, $cloudlayer++, "en")) { echo $clouds["sky"] . "<br>";
echo "coverage " . $clouds["cov1"] . "/8 to " . $clouds["cov2"] . "/8 at "; echo $clouds["meters"] . "m (" . $clouds["feet"] . "ft)"; echo "cumulus clouds: " . $clouds["cumulus"] ."<br><br>"; }
?>
will display all indicated cloud layers as follows:
few clouds at 3,000 feet coverage 1/8 to 2/8 at 1000m (3000ft) cumulus clouds: no
mostly cloudy at 40,000 feet with towering Cumulus clouds coverage 5/8 to 7/8 at 13000m (40000ft) cumulus clouds: towering
| Previous | Up | Next |