| Index | PHPmyEasyWeather | PHPmyEasyWeather Homepage |
getMetarFromWWW -- return METAR information from WWW
Array getMetarFromWWW (string $ICAO);
getMetarFromWWW returns METAR information for the given station ($ICAO) connecting the ftp server of weather.noaa.gov which provides weather information as a public service by NOAA's National Weather Service (NWS). Information presented there is considered public information and may be distributed or copied.
getMetarFromWWW needs an internet connection and expects a correct ICAO - airport code ($ICAO) otherwise it will return false. Also some airports donīt provide METAR information (for example moroccan airports as e.g. Agadir donīt like to transmit that kind of information to NOAA's National Weather Service) in that case getMetarFromWWW also will return false.
getMetarFromWWW returns an array with 3 elements and the following indexes:
Usage:
<?
include ("phpmyeasyweather.inc.php");
if ($input = getMetarFromWWW ("GCRR")) { $METAR = $input["metar"]; $DATE = $input["date"]; $TIME = $input["time"]; } else { echo "no METAR information found!"; }
?>
| Previous | Up | Next |