![]() | Welcome to Islandnet.com Locally owned and operated since 1993 |
| Create an Account • Pricing & Features • Domain Registration • Customer Sites • Help & Info | |
Wednesday August 27 2008 | |
Web Gadget: METARDescriptionThis gadget provides a PHP function that you can use to retrieve METAR weather information for a given location in the world. It takes care of parsing and interpreting the complex data and uses it to calculate additional information, which is returned to you in an array, making it easy to add current weather data to your sites.It also provides a global array of the available weather stations and key information about each one.
Usage Summary@include "gadget:metar"; DetailsThis gadget provides a global array named $METAR_station_data that has the 4 character station ID code as a key and several fields including 'na' (name), 'st' (state, only for US sites), 'co' (country), 'la' (latitude), 'lo' (longitude), and 'el' (elevation in meters). For example, this code:
displays the following:
This gadget also provides you with a PHP function named METAR that takes a single parameter: the 4 character weather station ID. It returns an associative array of values including temperature, wind speed and direction, visibility, and much more. For example, the following code:
produces the following output:
|