Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // FORECAST //////////////////////////////////////////////////////////////////////////////////////////
- $QueryForecastDecode = json_decode('Wunderground URL geolookup/conditions/forecast/q/autoip.xml');
- // build forecast array // forecast array structure: Day, Hi, Lo, ForecastText, ForecastIconURL, PrecipPercent
- $f = 0;
- $ForecastArray = array();
- while ($QueryForecastDecode->{'forecast'}->{'simpleforecast'}->{'forecastday'}[$f]) {
- $Forecasts = $QueryForecastDecode->{'forecast'}->{'simpleforecast'}->{'forecastday'}[$f];
- $ForecastArray[$f] = array(
- $Forecasts->{'date'}->{'weekday_short'},
- $Forecasts->{'high'}->{'fahrenheit'},
- $Forecasts->{'low'}->{'fahrenheit'},
- $Forecasts->{'conditions'},
- $Forecasts->{'icon_url'},
- $Forecasts->{'pop'}
- );
- $f++;
- }
- ?>
- <DOCTYPE html>
- <html>
- <body>
- <?php echo $ForecastArray; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement