Accessing elements directly
Brought to you by:
iridium
From: Tom G. <Tom...@LA...> - 2002-06-20 20:11:29
|
I currently have v 1.6x setup at: http://codeworks.org/phpweather/dtn.php displaying a table with 12 airports from our local area (within a couple of hundred miles). It currently gives an error if the cloud array is empty. I've decided to make it work with the new version... Here's my test code for accessing array elements directly. I used as a base a reply to a question on this list from back in March. Apparently the get_metar_value function doesn't exist anymore. Has it been replaced? Or, do I need to include some other files. I've searched through most of the files, but haven't been able to find it. All help is appreciated! Thanks! <?php error_reporting(E_ALL); require('./phpweather.php'); require('./pw_utilities.php'); $weather = new phpweather(array()); $weather->set_icao('KDTN'); $language = "en"; include(PHPWEATHER_BASE_DIR . "/output/pw_text_$language.php"); $type = 'pw_text_' . $language; $text = new $type($weather, array()); $text->print_pretty(); $temp_f = get_metar_value('temperature','temp_f'); echo "$temp_f °F"; echo '<pre>'; print_r($weather->decode_metar()); echo '</pre>'; ?> Tom Grant Louisiana CodeWORKS, Inc. 104 Marshall St. Minden, LA 71055 318-377-1149 / 800-489-1149 Voice/Fax 318-469-2934 / 877-489-1149 Cell |