Advertisement
Guest User

Untitled

a guest
May 3rd, 2012
1,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. // FORECAST //////////////////////////////////////////////////////////////////////////////////////////
  2.  
  3. $QueryForecastDecode = json_decode($QueryForecast);
  4.  
  5. // build forecast array // forecast array structure: Day, Hi, Lo, ForecastText, ForecastIconURL, PrecipPercent
  6. $f = 0;
  7. $ForecastArray = array();
  8. while ($QueryForecastDecode->{'forecast'}->{'simpleforecast'}->{'forecastday'}[$f]) {
  9.     $Forecasts = $QueryForecastDecode->{'forecast'}->{'simpleforecast'}->{'forecastday'}[$f];
  10.     $ForecastArray[$f] = array(
  11.         $Forecasts->{'date'}->{'weekday_short'},
  12.         $Forecasts->{'high'}->{'fahrenheit'},
  13.         $Forecasts->{'low'}->{'fahrenheit'},
  14.         $Forecasts->{'conditions'},
  15.         $Forecasts->{'icon_url'},
  16.         $Forecasts->{'pop'}
  17.     );
  18.     $f++;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement