Location: PHPKode > scripts > Weather.com API Class > sample.php
<?php
/** 
 * 
 * Weather Class usage
 * 
 * @see    http://www.weather.com
 * @author Rafael Santiago
 * @since 19/07/2010
 *
 */
 
require_once("Weather.class.php");

// CONFIG
$locId = "BRXX0037"; 		// LOCATION ID IN WEATHER.COM
$partnerId = '9999999999'; 	// PARTNER ID IN WEATHER.COM
$key = 'xxxxxxxxxxxxxxxx'; 	// ACCESS KEY

// INSTANCE
$objWeather = new Weather($locId, $partnerId, $key);

// ONLY ONE VALUE
echo $objWeather->getResult('TEMPERATURE');

// MULTIPLE VALUES
var_dump($objWeather->getResult(array('TEMPERATURE','WINDSPEED','WINDDIRECTION')));
?>
Return current item: Weather.com API Class