Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv4375

Modified Files:
        index.php 
Log Message:
The file now pretty-prints the METARs from 11 airports around the
world. This makes it easier to spot missing strings, etc.


Index: index.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/index.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- index.php   2001/04/06 15:03:18     1.4
+++ index.php   2001/04/08 09:59:54     1.5
@@ -24,7 +24,7 @@
 require('locale_en.php');
 require('phpweather.php');
 
-define('DEBUG', true);
+//define('DEBUG', true);
 
 
 $properties = array('db_hostname' => 'localhost',
@@ -70,12 +70,25 @@
 /* Checkpoint, we store the time */
 $time[] = array(microtime(), 'pretty-print finished');
 
-/*
-echo "<pre>\n";
-print_r($obj->decode_metar());
-echo "</pre>\n";
-*/
+$stations = array('FNLU', 'LOWW',
+                 'TXKF', 'CYOD',
+                 'MROC', 'HECA',
+                 'LFPG', 'EDDV',
+                 'HKNW', 'OKBK');
+$num_stations = count($stations);
+
+for ($i = 0; $i < $num_stations; $i++) {
+  echo "<h1>$stations[$i]</h1>\n";
+  $obj->set_station($stations[$i]);
+  $obj->print_pretty();
+  echo '<blockquote><code>' . $obj->metar . "</code></blockquote>";
+}
+
+/* Checkpoint, we store the time */
+$time[] = array(microtime(), '10 stations displayed');
 
+
+
 $max = count($time) - 1;
 for ($i = 0; $i < $max; $i++) {
   $start_time = explode(' ', $time[$i][0]);
@@ -83,6 +96,7 @@
   $diff = ($end_time[0] + $end_time[1]) - ($start_time[0] + $start_time[1]);
   echo '<p>Time taken to go from &quot;' . ($time[$i][1]) . '&quot; to &quot;' . 
($time[$i+1][1]) . '&quot;: ' . number_format($diff * 1000, 2) . " miliseconds.</p>\n";
 }
+
 
 $start_time = explode(' ', $time[0][0]);
 $end_time   = explode(' ', $time[$max][0]);


_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins

Reply via email to