This is somewhat right. Should get someone started. Using this is a Drupal block to display weather for an event.
< $datetime2){
$current = gmdate("Y-m-d", strtotime("+1 day", strtotime($current)));
$count++;
}
return $count;
}
$apikey = 'YOUR API KEY HERE';
$locationstring = "AL/Huntsville";
$json_string = file_get_contents("
http://api.wunderground.com/api/".$ap...");
$data = json_decode( $json_string );
$event_date = '2012-11-10'; //date of event you want
$todaydate =new DateTime("now");
$now = $todaydate?>format('Y-m-d' );
$interval = date_diff_cust( $now,$event_date ); //does not check for out of 10 day range yet
echo "
".$data->forecast->txt_forecast->forecastday[ $interval ]->fcttext ;
echo "

" ;
echo "
".$data->forecast->simpleforecast->forecastday[ $interval ]->date->weekday ." ".
$data->forecast->simpleforecast->forecastday[ $interval ]->date->month ."/".$data->forecast->simpleforecast->forecastday[ $interval ]->date->day ."/". $data->forecast->simpleforecast->forecastday[ $interval ]->date->year;
?>