openweathermap 관련 질문요

openweathermap 관련 질문요

QA

openweathermap 관련 질문요

본문

내일날씨와 습도도 넣고 싶은데 어떻게 해야하나요?

 

내일 날씨를 넣고 습도도 넣고싶은데 그럴려면 어떻게해야하나요?
 

 

      echo $cur_weather."  ";
      echo $cur_temp." ℃ |";

 


$w_condition_json = file_get_contents("./board/weather/icons.json");
$w_condition = json_decode($w_condition_json,true);


$cur_weather = strtolower($w_result->weather[0]->main);//오늘 날씨 소문자로...

$cur_temp_min = sprintf("%2.1f",$w_result->main->temp_min - 273.15);//오늘 최저 온도
$cur_temp_max = sprintf("%2.1f",$w_result->main->temp_max - 273.15);//오늘 최고 온도
$cur_temp = sprintf("%2.1f",$w_result->main->temp - 273.15);//오늘 현재온도

$cur_icon = $w_result->weather[0]->icon;//날씨아이콘이름
$cur_icon_id = $w_result->weather[0]->id;//날씨아이콘 id(숫자)

$cur_weather_han = $w_condition[$cur_icon_id]['han'];//날씨상태 한글

//시간대별로 아이콘폰트를 다르게 설정
$ymd = date("Y-m-d");
$cur_time = time();
$date1 = strtotime($ymd." 09:00:00");
$date2 = strtotime($ymd." 16:00:00");
$date3 = strtotime($ymd." 18:00:00");
$date5 = strtotime($ymd." 23:59:59");
$date6 = strtotime($ymd." 00:01:01");
$date7 = strtotime($ymd." 06:00:00");

if($cur_time > $date1 && $cur_time < $date2) $owm_icon = "wi-owm-day-".$cur_icon_id; //낮
elseif($cur_time > $date3 && $cur_time < $date5) $owm_icon = "wi-owm-night-".$cur_icon_id; //밤
elseif($cur_time > $date6 && $cur_time < $date7) $owm_icon = "wi-owm-night-".$cur_icon_id; //밤
else $owm_icon = "wi-owm-".$cur_icon_id; //아침과 해거름  

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 8
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT