구글날씨API

구글날씨 정보XML 받아서 홈페이지에 출력하는 방법 ( weather.com을 추천한다.)

구글날씨 정보XML 받아서 홈페이지에 출력하는 방법 – 한 5년전 자료이다. 그래도 백업해본다~ <?php echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'; ## 한글utf-8함수 ############################# function koutf($kor){ $return = iconv("EUC-KR","UTF-8", $kor); return $return; } ############################################ $xml_data= @file_get_contents('http://www.google.co.kr/ig/api?weather=seoul'); $xml_data = iconv("EUC-KR","UTF-8", $xml_data); $tst = new SimpleXMLElement ($xml_data); // children 값 구할때 ## SimpleXMLElement::children /* foreach ($tst->children() as $child) { echo […]

Scroll to top