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

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

팁앤테크

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

페이지 정보

본문

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");
추천0

첨부파일

댓글목록

등록된 댓글이 없습니다.

Total 825건 7 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
705 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12782 0 04-19
704 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10016 0 03-23
703 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10038 0 03-17
702 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10787 0 02-25
701 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11267 0 02-19
700 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10337 0 02-19
699 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10063 0 02-19
698 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10235 0 02-17
697 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9595 0 02-08
696 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10736 0 02-08
695 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10510 0 02-06
694 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10347 0 02-06
693 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10850 0 02-06
692 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10506 0 02-04
691 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13272 0 02-04
690 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9452 0 02-03
689 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9916 0 02-02
688 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9864 0 01-23
687 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13729 0 01-09
686 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11520 0 12-09

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
618
어제
4,566
최대
6,509
전체
1,065,279
Copyright (c) 株式会社YHPLUS. All rights reserved.