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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 59,429회 작성일 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 829건 7 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
679 제로 43308 07-23
678 제로 40976 07-07
677 제로 41751 07-01
676 제로 46096 07-01
675 제로 39261 06-25
674 제로 41774 05-15
673 제로 48812 05-09
672 제로 36777 04-23
671 제로 42193 04-16
670 제로 53492 04-10
669 제로 55741 03-19
668 제로 50051 03-03
667 제로 52319 02-23
666 제로 40165 02-20
665 제로 45240 02-20
664 제로 37971 02-20
663 제로 39881 02-10
662 제로 51858 01-28
661 제로 34247 01-28
660 제로 40687 01-25
659 제로 40023 01-23
열람중 제로 59430 01-05
657 제로 35980 12-19
656 제로 40220 12-17
655 제로 55870 12-02

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
47,086
어제
25,218
최대
431,155
전체
7,322,879
Copyright (c) 株式会社YHPLUS. All rights reserved.