At 11:48 AM +0100 3/18/01, Martin Geisler wrote:
>> Right now it's gonna take quite a bit of editing, no?
>
>Actually not. To demonstrate, I've made a very rough print_table()
>function. It's not very pretty at the moment, but I hope that someone
>could make it better. For example, you should be able to specify the
>direction of the table, perhaps someone wants the headings to be in
>the left column, and then have the data in the right one. To do this,
>you would have to extend the defaults with something like
>'table_direction'. There should also be set and get function for this.
>
>You'll find the rought print_table in beta-1.9.3.
>
Ahhh. I see! I was going about something like:
$myarray = $obj->decode_metar();
while (list($key,$val)=each($myarray)) {
if ($key == "wind") {
$windarray = $val;
while (list($key,$val)=each($windarray)) {
echo $key." ---> ".$val."<br>";
}
}
Your solution is much more elegant! The only thing I found so far when
looping through a bunch of metars was I need to add the following to the
print_table($data):
if (!in_array('rel_humidity', $this->properties['exclude']) &&
!empty($rel_humidity)) {
$humidity = $rel_humidity . '%';
}else{
$humidity = "NA";
}
Thanks, Martin!
-fred