example

  1. <?php
  2.   // Instance Sensor object
  3.   $sensors array('thb0''th0''rain0''wind0');
  4.   $units array('local''hpa''c''mm''kmh');
  5.   $station new Station('all-sensors.xml'$sensors$units);
  6.  
  7.   // Get station attributes
  8.   echo $station->sensors->inside// Return thb0
  9.   echo $station->units->date;     // Return local
  10.  
  11.   // Get weather station values
  12.   // Short tags:
  13.   echo $station->actual_outside_temp      // Return actual temperature of the outside sensor in the units defined in the Station constructor
  14.   echo $station->year1_total_rain         // Return total rain of the actual year in the units defined in the Station constructor
  15.   
  16.   // Long tags:
  17.   echo $station->actual_th0_temp_c        // Return actual temperature of the th0(outside) sensor in degrees Celsius
  18.   echo $station->year1_rain0_total_mm     // Return total rain of the actual year in mm

Documentation generated on Mon, 17 Oct 2011 16:46:21 +0200 by phpDocumentor 1.4.3