[php] 외환은행 환율 파싱해 오기 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[php] 외환은행 환율 파싱해 오기

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 58,113회 작성일 15-01-05 18:22

본문

include $g4['path']."/parser/simple_html_dom.php";
//실시간 환율정보
function s_price_baht($type){
 $url = "http://fx.keb.co.kr/FER1101C.web"; //자신이 원하는 페이지

 // get DOM from URL or file
 $html = file_get_html($url);

 //기준일
 foreach($html->find('dd[id=dispTime]') as $dd_txt) {
   $insert_time = $dd_txt;
 }

 //고시시간
 foreach($html->find('dd[id=regdt]') as $dd_txt) {
   $insert_date = $dd_txt;
 }

 $txt_array = array();
 // find all td tags with attribite align=center
 foreach($html->find('table[class=tbl_list_type2]') as $tb_txt){
  //echo $tb_txt->innertext."<br>";
 
  $k = 1;
  foreach($tb_txt->find('tr') as $tr_txt) {
   //echo $tr_txt->innertext."<br>";
   $i = 1;
   foreach($tr_txt->find('td') as $td_txt) {
    $txt_array[$i] = strip_tags($td_txt->innertext);
    if($k=="4" && $i=="10"){
     $insert_thb =  strip_tags($td_txt->innertext);
    }
   $i++;
   }

  $k++;
  }
 }

 if($type=="date"){
  return $insert_date;
 }else if($type=="time"){
  return $insert_time;
 }else if($type=="price"){
  return $insert_thb;
 }
}

echo "기준일:".s_price_baht("date"). "고시시간:".s_price_baht("time"). "매매 기준율:".s_price_baht("price");

첨부파일

댓글목록

등록된 댓글이 없습니다.

Total 779건 7 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
629 제로 42519 07-23
628 제로 40172 07-07
627 제로 40934 07-01
626 제로 45341 07-01
625 제로 38638 06-25
624 제로 41136 05-15
623 제로 47976 05-09
622 제로 36105 04-23
621 제로 41504 04-16
620 제로 52691 04-10
619 제로 54993 03-19
618 제로 49285 03-03
617 제로 51287 02-23
616 제로 39431 02-20
615 제로 44588 02-20
614 제로 37280 02-20
613 제로 39169 02-10
612 제로 51066 01-28
611 제로 33699 01-28
610 제로 40040 01-25
609 제로 39303 01-23
열람중 제로 58114 01-05
607 제로 35482 12-19
606 제로 39680 12-17
605 제로 54998 12-02

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5470-4714
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
912
어제
25,212
최대
431,155
전체
6,726,164
Copyright (c) 株式会社YHPLUS. All rights reserved.