"40.7409", 'longitude' => "-73.9997", 'startDate' => $today, 'numDays' => '2', 'format' => '24 hourly' ); $result = $client->call('NDFDgenByDay',$params); $error = $client->getError(); if ($error) { echo "error
";
  print_r($error);
  print_r($result);
  echo "
"; exit; } $xml = simplexml_load_string($result); $dayNames = array(); $weatherDates = array(); foreach($xml->data->{'time-layout'}->{'start-valid-time'} AS $time) { $weatherDates[] = (string) $time; $dayNames[] = date("l", strtotime($time)); } $maxTemperature = array(); foreach($xml->data->parameters->temperature[0]->value AS $maxTemp) { $maxTemperature[] = (int) $maxTemp; } $minTemperature = array(); foreach($xml->data->parameters->temperature[1]->value AS $minTemp) { $minTemperature[] = (int) $minTemp; } $icons = array(); foreach($xml->data->parameters->{'conditions-icon'}->{'icon-link'} as $icon) { $icons[] = (string) $icon; } echo "\n"; $day = 0; while(isset($weatherDates[$day])) { echo ""; $day++; } echo ""; echo ""; $day = 0; while(isset($weatherDates[$day])) { echo ""; echo ""; $day++; } echo "
{$dayNames[$day]}
Low: {$minTemperature[$day]}
"; echo "High:{$maxTemperature[$day]}
\n\n
"; ?>