Weather

<?php
include('forecast.io.php');
$api_key = '82d56a7194883bceaa17ea6e6921b907';
$latitude = '38.9428';
$longitude = '-84.5543';
$units = 'us';
$lang = 'en';
$forecast = new ForecastIO($api_key, $units, $lang);
// all default will be
// $forecast = new ForecastIO($api_key);
/*
* GET CURRENT CONDITIONS
*/
$condition = $forecast->getCurrentConditions($latitude, $longitude);
echo "Current Temperature: " . round($condition->getTemperature()) . " | " . round($condition->getApparentTemperature()) . "<br>";
echo "Dew Point Temp: " . round($condition->getDewPoint()) . "<br>";

/*
* GET HOURLY CONDITIONS FOR TODAY
*/
$conditions_today = $forecast->getForecastToday($latitude, $longitude);
echo "<br>" . "Hourly Temperature" . "<br>";
foreach($conditions_today as $cond) {
echo $cond->getTime('ga') . ': ' . round($cond->getTemperature()). "<br>";
}
/*
* GET DAILY CONDITIONS FOR NEXT 7 DAYS
*/
$conditions_week = $forecast->getForecastWeek($latitude, $longitude);
echo "<br>" . "Highs This Week" . "<br>";
echo "<table border=\"1\" style=\"font-size:2em\"><tr>";
foreach($conditions_week as $conditions) {

echo "<td>" . $conditions->getTime('l M d') . "</td><td>" . round($conditions->getMaxTemperature()) . "</td><td>" . round($conditions->getMinTemperature()) . "</td></tr>";
}
echo "</table>";
?>