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

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

팁앤테크

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

페이지 정보

profile_image
작성자 제로
댓글 0건 조회 67,400회 작성일 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건 1 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
829 제로 6781 06-18
828 제로 9783 03-21
827 제로 8622 02-23
826 제로 33922 11-02
825 제로 36870 07-10
824 제로 54335 04-06
823 제로 34794 02-21
822 제로 43514 12-31
821 제로 34038 12-24
820 제로 33862 12-04
819 제로 36976 10-17
818 제로 35553 10-02
817 제로 69902 08-04
816 제로 33674 08-04
815 제로 49651 08-03
814 제로 50150 07-08
813 제로 84830 07-08
812 제로 103841 07-06
811 제로 35000 06-09
810 제로 41701 06-03
809 제로 39821 04-16
808 제로 40537 03-29
807 제로 33974 03-26
806 제로 43211 03-12
805 제로 36437 03-10

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
10,750
어제
21,904
최대
431,155
전체
12,244,375
Copyright (c) 株式会社YHPLUS. All rights reserved.