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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 60,536회 작성일 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 제로 43913 07-23
678 제로 41595 07-07
677 제로 42286 07-01
676 제로 46649 07-01
675 제로 39772 06-25
674 제로 42309 05-15
673 제로 49435 05-09
672 제로 37298 04-23
671 제로 42774 04-16
670 제로 54146 04-10
669 제로 56298 03-19
668 제로 50868 03-03
667 제로 53055 02-23
666 제로 40691 02-20
665 제로 45675 02-20
664 제로 38465 02-20
663 제로 40379 02-10
662 제로 52430 01-28
661 제로 34655 01-28
660 제로 41110 01-25
659 제로 40500 01-23
열람중 제로 60537 01-05
657 제로 36331 12-19
656 제로 40722 12-17
655 제로 56524 12-02

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
9,280
어제
106,664
최대
431,155
전체
8,571,511
Copyright (c) 株式会社YHPLUS. All rights reserved.